
// this is autogenerated file, do not edit it.
#include "ficus/ficus.h"

struct _fx_Nt6option1N10Ast__typ_t_data_t;

static void _fx_free_Nt6option1N10Ast__typ_t(struct _fx_Nt6option1N10Ast__typ_t_data_t** dst);

struct _fx_Nt6option1N10Ast__exp_t_data_t;

static void _fx_free_Nt6option1N10Ast__exp_t(struct _fx_Nt6option1N10Ast__exp_t_data_t** dst);

struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t;

static void _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t** dst);

struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t;

static void _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t** dst);

struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t;

static void _fx_free_Nt11Set__tree_t1R9Ast__id_t(struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t** dst);

struct _fx_N10Ast__typ_t_data_t;

static void _fx_free_N10Ast__typ_t(struct _fx_N10Ast__typ_t_data_t** dst);

struct _fx_N13Ast__binary_t_data_t;

static void _fx_free_N13Ast__binary_t(struct _fx_N13Ast__binary_t_data_t** dst);

struct _fx_N10Ast__exp_t_data_t;

static void _fx_free_N10Ast__exp_t(struct _fx_N10Ast__exp_t_data_t** dst);

struct _fx_N10Ast__pat_t_data_t;

static void _fx_free_N10Ast__pat_t(struct _fx_N10Ast__pat_t_data_t** dst);

struct _fx_N16Ast__env_entry_t_data_t;

static void _fx_free_N16Ast__env_entry_t(struct _fx_N16Ast__env_entry_t_data_t** dst);

struct _fx_N16Ast__defmodule_t_data_t;

static void _fx_free_N16Ast__defmodule_t(struct _fx_N16Ast__defmodule_t_data_t** dst);

struct _fx_N14K_form__ktyp_t_data_t;

static void _fx_free_N14K_form__ktyp_t(struct _fx_N14K_form__ktyp_t_data_t** dst);

struct _fx_N14K_form__kexp_t_data_t;

static void _fx_free_N14K_form__kexp_t(struct _fx_N14K_form__kexp_t_data_t** dst);

typedef struct _fx_Nt6option1N10Ast__typ_t_data_t {
   int_ rc;
   union {
      struct _fx_N10Ast__typ_t_data_t* Some;
   } u;
} _fx_Nt6option1N10Ast__typ_t_data_t, *_fx_Nt6option1N10Ast__typ_t;

typedef struct _fx_LS_data_t {
   int_ rc;
   struct _fx_LS_data_t* tl;
   fx_str_t hd;
} _fx_LS_data_t, *_fx_LS;

typedef struct _fx_Ta2i {
   int_ t0;
   int_ t1;
} _fx_Ta2i;

typedef struct _fx_T2Ta2iS {
   struct _fx_Ta2i t0;
   fx_str_t t1;
} _fx_T2Ta2iS;

typedef struct _fx_R9Ast__id_t {
   int_ m;
   int_ i;
   int_ j;
} _fx_R9Ast__id_t;

typedef struct _fx_R10Ast__loc_t {
   int_ m_idx;
   int_ line0;
   int_ col0;
   int_ line1;
   int_ col1;
} _fx_R10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_ti {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
} _fx_T2R9Ast__id_ti;

typedef struct _fx_T2Bi {
   bool t0;
   int_ t1;
} _fx_T2Bi;

typedef struct _fx_N12Ast__scope_t {
   int tag;
   union {
      int_ ScBlock;
      struct _fx_T2Bi ScLoop;
      int_ ScFold;
      int_ ScArrMap;
      int_ ScMap;
      int_ ScTry;
      struct _fx_R9Ast__id_t ScFun;
      struct _fx_R9Ast__id_t ScClass;
      struct _fx_R9Ast__id_t ScInterface;
      int_ ScModule;
   } u;
} _fx_N12Ast__scope_t;

typedef struct _fx_LN12Ast__scope_t_data_t {
   int_ rc;
   struct _fx_LN12Ast__scope_t_data_t* tl;
   struct _fx_N12Ast__scope_t hd;
} _fx_LN12Ast__scope_t_data_t, *_fx_LN12Ast__scope_t;

typedef struct _fx_R16Ast__val_flags_t {
   bool val_flag_arg;
   bool val_flag_mutable;
   bool val_flag_temp;
   bool val_flag_tempref;
   bool val_flag_private;
   bool val_flag_subarray;
   bool val_flag_instance;
   struct _fx_T2R9Ast__id_ti val_flag_method;
   int_ val_flag_ctor;
   struct _fx_LN12Ast__scope_t_data_t* val_flag_global;
} _fx_R16Ast__val_flags_t;

typedef struct _fx_N17Ast__fun_constr_t {
   int tag;
   union {
      int_ CtorVariant;
      struct _fx_R9Ast__id_t CtorFP;
      struct _fx_R9Ast__id_t CtorExn;
   } u;
} _fx_N17Ast__fun_constr_t;

typedef struct _fx_R16Ast__fun_flags_t {
   int_ fun_flag_pure;
   bool fun_flag_ccode;
   bool fun_flag_have_keywords;
   bool fun_flag_inline;
   bool fun_flag_nothrow;
   bool fun_flag_really_nothrow;
   bool fun_flag_private;
   struct _fx_N17Ast__fun_constr_t fun_flag_ctor;
   struct _fx_R9Ast__id_t fun_flag_method_of;
   bool fun_flag_uses_fv;
   bool fun_flag_recursive;
   bool fun_flag_instance;
} _fx_R16Ast__fun_flags_t;

typedef struct _fx_Ta2R9Ast__id_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_R9Ast__id_t t1;
} _fx_Ta2R9Ast__id_t;

typedef struct _fx_LR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LR9Ast__id_t_data_t* tl;
   struct _fx_R9Ast__id_t hd;
} _fx_LR9Ast__id_t_data_t, *_fx_LR9Ast__id_t;

typedef struct _fx_R17K_form__kdefval_t {
   struct _fx_R9Ast__id_t kv_name;
   fx_str_t kv_cname;
   struct _fx_N14K_form__ktyp_t_data_t* kv_typ;
   struct _fx_R16Ast__val_flags_t kv_flags;
   struct _fx_R10Ast__loc_t kv_loc;
} _fx_R17K_form__kdefval_t;

typedef struct _fx_T2R9Ast__id_tN14K_form__ktyp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
} _fx_T2R9Ast__id_tN14K_form__ktyp_t;

typedef struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t hd;
} _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t, *_fx_LT2R9Ast__id_tN14K_form__ktyp_t;

typedef struct _fx_R23K_form__kdefinterface_t {
   struct _fx_R9Ast__id_t ki_name;
   struct _fx_R9Ast__id_t ki_base;
   fx_str_t ki_cname;
   struct _fx_R9Ast__id_t ki_id;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* ki_all_methods;
   struct _fx_LN12Ast__scope_t_data_t* ki_scope;
   struct _fx_R10Ast__loc_t ki_loc;
} _fx_R23K_form__kdefinterface_t;

typedef struct _fx_rR23K_form__kdefinterface_t_data_t {
   int_ rc;
   struct _fx_R23K_form__kdefinterface_t data;
} _fx_rR23K_form__kdefinterface_t_data_t, *_fx_rR23K_form__kdefinterface_t;

typedef struct _fx_R25K_form__kdefclosureinfo_t {
   struct _fx_R9Ast__id_t kci_arg;
   struct _fx_R9Ast__id_t kci_fcv_t;
   struct _fx_R9Ast__id_t kci_fp_typ;
   struct _fx_R9Ast__id_t kci_make_fp;
   struct _fx_R9Ast__id_t kci_wrap_f;
} _fx_R25K_form__kdefclosureinfo_t;

typedef struct _fx_R17K_form__kdeffun_t {
   struct _fx_R9Ast__id_t kf_name;
   fx_str_t kf_cname;
   struct _fx_LR9Ast__id_t_data_t* kf_params;
   struct _fx_N14K_form__ktyp_t_data_t* kf_rt;
   struct _fx_N14K_form__kexp_t_data_t* kf_body;
   struct _fx_R16Ast__fun_flags_t kf_flags;
   struct _fx_R25K_form__kdefclosureinfo_t kf_closure;
   struct _fx_LN12Ast__scope_t_data_t* kf_scope;
   struct _fx_R10Ast__loc_t kf_loc;
} _fx_R17K_form__kdeffun_t;

typedef struct _fx_rR17K_form__kdeffun_t_data_t {
   int_ rc;
   struct _fx_R17K_form__kdeffun_t data;
} _fx_rR17K_form__kdeffun_t_data_t, *_fx_rR17K_form__kdeffun_t;

typedef struct _fx_R17K_form__kdefexn_t {
   struct _fx_R9Ast__id_t ke_name;
   fx_str_t ke_cname;
   fx_str_t ke_base_cname;
   struct _fx_N14K_form__ktyp_t_data_t* ke_typ;
   bool ke_std;
   struct _fx_R9Ast__id_t ke_tag;
   struct _fx_R9Ast__id_t ke_make;
   struct _fx_LN12Ast__scope_t_data_t* ke_scope;
   struct _fx_R10Ast__loc_t ke_loc;
} _fx_R17K_form__kdefexn_t;

typedef struct _fx_rR17K_form__kdefexn_t_data_t {
   int_ rc;
   struct _fx_R17K_form__kdefexn_t data;
} _fx_rR17K_form__kdefexn_t_data_t, *_fx_rR17K_form__kdefexn_t;

typedef struct _fx_R17K_form__ktprops_t {
   bool ktp_complex;
   bool ktp_scalar;
   bool ktp_ptr;
   bool ktp_pass_by_ref;
   bool ktp_custom_free;
   bool ktp_custom_copy;
} _fx_R17K_form__ktprops_t;

typedef struct _fx_Nt6option1R17K_form__ktprops_t {
   int tag;
   union {
      struct _fx_R17K_form__ktprops_t Some;
   } u;
} _fx_Nt6option1R17K_form__ktprops_t;

typedef struct _fx_R16Ast__var_flags_t {
   int_ var_flag_class_from;
   bool var_flag_record;
   bool var_flag_recursive;
   bool var_flag_have_tag;
   bool var_flag_have_mutable;
   bool var_flag_opt;
   bool var_flag_instance;
} _fx_R16Ast__var_flags_t;

typedef struct _fx_LN14K_form__ktyp_t_data_t {
   int_ rc;
   struct _fx_LN14K_form__ktyp_t_data_t* tl;
   struct _fx_N14K_form__ktyp_t_data_t* hd;
} _fx_LN14K_form__ktyp_t_data_t, *_fx_LN14K_form__ktyp_t;

typedef struct _fx_T2R9Ast__id_tLR9Ast__id_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
} _fx_T2R9Ast__id_tLR9Ast__id_t;

typedef struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t* tl;
   struct _fx_T2R9Ast__id_tLR9Ast__id_t hd;
} _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t, *_fx_LT2R9Ast__id_tLR9Ast__id_t;

typedef struct _fx_R21K_form__kdefvariant_t {
   struct _fx_R9Ast__id_t kvar_name;
   fx_str_t kvar_cname;
   struct _fx_R9Ast__id_t kvar_proto;
   struct _fx_Nt6option1R17K_form__ktprops_t kvar_props;
   struct _fx_LN14K_form__ktyp_t_data_t* kvar_targs;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* kvar_cases;
   struct _fx_LR9Ast__id_t_data_t* kvar_ctors;
   struct _fx_R16Ast__var_flags_t kvar_flags;
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t* kvar_ifaces;
   struct _fx_LN12Ast__scope_t_data_t* kvar_scope;
   struct _fx_R10Ast__loc_t kvar_loc;
} _fx_R21K_form__kdefvariant_t;

typedef struct _fx_rR21K_form__kdefvariant_t_data_t {
   int_ rc;
   struct _fx_R21K_form__kdefvariant_t data;
} _fx_rR21K_form__kdefvariant_t_data_t, *_fx_rR21K_form__kdefvariant_t;

typedef struct _fx_R17K_form__kdeftyp_t {
   struct _fx_R9Ast__id_t kt_name;
   fx_str_t kt_cname;
   struct _fx_R9Ast__id_t kt_proto;
   struct _fx_Nt6option1R17K_form__ktprops_t kt_props;
   struct _fx_LN14K_form__ktyp_t_data_t* kt_targs;
   struct _fx_N14K_form__ktyp_t_data_t* kt_typ;
   struct _fx_LN12Ast__scope_t_data_t* kt_scope;
   struct _fx_R10Ast__loc_t kt_loc;
} _fx_R17K_form__kdeftyp_t;

typedef struct _fx_rR17K_form__kdeftyp_t_data_t {
   int_ rc;
   struct _fx_R17K_form__kdeftyp_t data;
} _fx_rR17K_form__kdeftyp_t_data_t, *_fx_rR17K_form__kdeftyp_t;

typedef struct _fx_R25K_form__kdefclosurevars_t {
   struct _fx_R9Ast__id_t kcv_name;
   fx_str_t kcv_cname;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* kcv_freevars;
   struct _fx_LR9Ast__id_t_data_t* kcv_orig_freevars;
   struct _fx_LN12Ast__scope_t_data_t* kcv_scope;
   struct _fx_R10Ast__loc_t kcv_loc;
} _fx_R25K_form__kdefclosurevars_t;

typedef struct _fx_rR25K_form__kdefclosurevars_t_data_t {
   int_ rc;
   struct _fx_R25K_form__kdefclosurevars_t data;
} _fx_rR25K_form__kdefclosurevars_t_data_t, *_fx_rR25K_form__kdefclosurevars_t;

typedef struct _fx_N15K_form__kinfo_t {
   int tag;
   union {
      struct _fx_R17K_form__kdefval_t KVal;
      struct _fx_rR17K_form__kdeffun_t_data_t* KFun;
      struct _fx_rR17K_form__kdefexn_t_data_t* KExn;
      struct _fx_rR21K_form__kdefvariant_t_data_t* KVariant;
      struct _fx_rR25K_form__kdefclosurevars_t_data_t* KClosureVars;
      struct _fx_rR23K_form__kdefinterface_t_data_t* KInterface;
      struct _fx_rR17K_form__kdeftyp_t_data_t* KTyp;
   } u;
} _fx_N15K_form__kinfo_t;

typedef struct _fx_Nt6option1R9Ast__id_t {
   int tag;
   union {
      struct _fx_R9Ast__id_t Some;
   } u;
} _fx_Nt6option1R9Ast__id_t;

typedef struct _fx_Nt6option1N10Ast__exp_t_data_t {
   int_ rc;
   union {
      struct _fx_N10Ast__exp_t_data_t* Some;
   } u;
} _fx_Nt6option1N10Ast__exp_t_data_t, *_fx_Nt6option1N10Ast__exp_t;

typedef struct _fx_R13Ast__defval_t {
   struct _fx_R9Ast__id_t dv_name;
   struct _fx_N10Ast__typ_t_data_t* dv_typ;
   struct _fx_R16Ast__val_flags_t dv_flags;
   struct _fx_LN12Ast__scope_t_data_t* dv_scope;
   struct _fx_R10Ast__loc_t dv_loc;
} _fx_R13Ast__defval_t;

typedef struct _fx_FPi2R9Ast__id_tR9Ast__id_t {
   int (*fp)(struct _fx_R9Ast__id_t*, struct _fx_R9Ast__id_t*, int_*, void*);
   fx_fcv_t* fcv;
} _fx_FPi2R9Ast__id_tR9Ast__id_t;

typedef struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t {
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* root;
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t cmp;
} _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t;

typedef struct _fx_LN10Ast__pat_t_data_t {
   int_ rc;
   struct _fx_LN10Ast__pat_t_data_t* tl;
   struct _fx_N10Ast__pat_t_data_t* hd;
} _fx_LN10Ast__pat_t_data_t, *_fx_LN10Ast__pat_t;

typedef struct _fx_rLR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LR9Ast__id_t_data_t* data;
} _fx_rLR9Ast__id_t_data_t, *_fx_rLR9Ast__id_t;

typedef struct _fx_R13Ast__deffun_t {
   struct _fx_R9Ast__id_t df_name;
   struct _fx_LR9Ast__id_t_data_t* df_templ_args;
   struct _fx_LN10Ast__pat_t_data_t* df_args;
   struct _fx_N10Ast__typ_t_data_t* df_typ;
   struct _fx_N10Ast__exp_t_data_t* df_body;
   struct _fx_R16Ast__fun_flags_t df_flags;
   struct _fx_LN12Ast__scope_t_data_t* df_scope;
   struct _fx_R10Ast__loc_t df_loc;
   struct _fx_rLR9Ast__id_t_data_t* df_templ_inst;
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t df_env;
} _fx_R13Ast__deffun_t;

typedef struct _fx_rR13Ast__deffun_t_data_t {
   int_ rc;
   struct _fx_R13Ast__deffun_t data;
} _fx_rR13Ast__deffun_t_data_t, *_fx_rR13Ast__deffun_t;

typedef struct _fx_R13Ast__defexn_t {
   struct _fx_R9Ast__id_t dexn_name;
   struct _fx_N10Ast__typ_t_data_t* dexn_typ;
   struct _fx_LN12Ast__scope_t_data_t* dexn_scope;
   struct _fx_R10Ast__loc_t dexn_loc;
} _fx_R13Ast__defexn_t;

typedef struct _fx_rR13Ast__defexn_t_data_t {
   int_ rc;
   struct _fx_R13Ast__defexn_t data;
} _fx_rR13Ast__defexn_t_data_t, *_fx_rR13Ast__defexn_t;

typedef struct _fx_R13Ast__deftyp_t {
   struct _fx_R9Ast__id_t dt_name;
   struct _fx_LR9Ast__id_t_data_t* dt_templ_args;
   struct _fx_N10Ast__typ_t_data_t* dt_typ;
   bool dt_finalized;
   struct _fx_LN12Ast__scope_t_data_t* dt_scope;
   struct _fx_R10Ast__loc_t dt_loc;
} _fx_R13Ast__deftyp_t;

typedef struct _fx_rR13Ast__deftyp_t_data_t {
   int_ rc;
   struct _fx_R13Ast__deftyp_t data;
} _fx_rR13Ast__deftyp_t_data_t, *_fx_rR13Ast__deftyp_t;

typedef struct _fx_T2R9Ast__id_tN10Ast__typ_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2R9Ast__id_tN10Ast__typ_t;

typedef struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN10Ast__typ_t hd;
} _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t, *_fx_LT2R9Ast__id_tN10Ast__typ_t;

typedef struct _fx_LTa2R9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LTa2R9Ast__id_t_data_t* tl;
   struct _fx_Ta2R9Ast__id_t hd;
} _fx_LTa2R9Ast__id_t_data_t, *_fx_LTa2R9Ast__id_t;

typedef struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LTa2R9Ast__id_t_data_t* t1;
} _fx_T2R9Ast__id_tLTa2R9Ast__id_t;

typedef struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* tl;
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t hd;
} _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t, *_fx_LT2R9Ast__id_tLTa2R9Ast__id_t;

typedef struct _fx_R17Ast__defvariant_t {
   struct _fx_R9Ast__id_t dvar_name;
   struct _fx_LR9Ast__id_t_data_t* dvar_templ_args;
   struct _fx_N10Ast__typ_t_data_t* dvar_alias;
   struct _fx_R16Ast__var_flags_t dvar_flags;
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* dvar_cases;
   struct _fx_LR9Ast__id_t_data_t* dvar_ctors;
   struct _fx_rLR9Ast__id_t_data_t* dvar_templ_inst;
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* dvar_ifaces;
   struct _fx_LN12Ast__scope_t_data_t* dvar_scope;
   struct _fx_R10Ast__loc_t dvar_loc;
} _fx_R17Ast__defvariant_t;

typedef struct _fx_rR17Ast__defvariant_t_data_t {
   int_ rc;
   struct _fx_R17Ast__defvariant_t data;
} _fx_rR17Ast__defvariant_t_data_t, *_fx_rR17Ast__defvariant_t;

typedef struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_R16Ast__fun_flags_t t2;
} _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t;

typedef struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t {
   int_ rc;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* tl;
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t hd;
} _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t, *_fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t;

typedef struct _fx_R19Ast__definterface_t {
   struct _fx_R9Ast__id_t di_name;
   struct _fx_R9Ast__id_t di_base;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* di_new_methods;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* di_all_methods;
   struct _fx_LN12Ast__scope_t_data_t* di_scope;
   struct _fx_R10Ast__loc_t di_loc;
} _fx_R19Ast__definterface_t;

typedef struct _fx_rR19Ast__definterface_t_data_t {
   int_ rc;
   struct _fx_R19Ast__definterface_t data;
} _fx_rR19Ast__definterface_t_data_t, *_fx_rR19Ast__definterface_t;

typedef struct _fx_N14Ast__id_info_t {
   int tag;
   union {
      struct _fx_R13Ast__defval_t IdDVal;
      struct _fx_rR13Ast__deffun_t_data_t* IdFun;
      struct _fx_rR13Ast__defexn_t_data_t* IdExn;
      struct _fx_rR13Ast__deftyp_t_data_t* IdTyp;
      struct _fx_rR17Ast__defvariant_t_data_t* IdVariant;
      struct _fx_rR19Ast__definterface_t_data_t* IdInterface;
      int_ IdModule;
   } u;
} _fx_N14Ast__id_info_t;

typedef struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t {
   int_ t0;
   fx_arr_t t1;
   struct _fx_N14Ast__id_info_t t2;
} _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t;

typedef struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t {
   int_ rc;
   union {
      struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t t;
   } u;
} _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t, *_fx_Nt9Dynvec__t1N14Ast__id_info_t;

typedef struct _fx_N12Map__color_t {
   int tag;
} _fx_N12Map__color_t;

typedef struct _fx_LN16Ast__env_entry_t_data_t {
   int_ rc;
   struct _fx_LN16Ast__env_entry_t_data_t* tl;
   struct _fx_N16Ast__env_entry_t_data_t* hd;
} _fx_LN16Ast__env_entry_t_data_t, *_fx_LN16Ast__env_entry_t;

typedef struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t {
   struct _fx_N12Map__color_t t0;
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t1;
   struct _fx_R9Ast__id_t t2;
   struct _fx_LN16Ast__env_entry_t_data_t* t3;
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t4;
} _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t;

typedef struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t {
   int_ rc;
   union {
      struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t
         Node;
   } u;
} _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t, *_fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t;

typedef struct _fx_N12Set__color_t {
   int tag;
} _fx_N12Set__color_t;

typedef struct _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t {
   struct _fx_N12Set__color_t t0;
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t1;
   struct _fx_R9Ast__id_t t2;
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t3;
} _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t;

typedef struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t {
   int_ rc;
   union {
      struct _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t Node;
   } u;
} _fx_Nt11Set__tree_t1R9Ast__id_t_data_t, *_fx_Nt11Set__tree_t1R9Ast__id_t;

typedef struct _fx_Rt6Set__t1R9Ast__id_t {
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* root;
   int_ size;
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t cmp;
} _fx_Rt6Set__t1R9Ast__id_t;

typedef struct _fx_T2R10Ast__loc_tS {
   struct _fx_R10Ast__loc_t t0;
   fx_str_t t1;
} _fx_T2R10Ast__loc_tS;

typedef struct _fx_T2il {
   int_ t0;
   int64_t t1;
} _fx_T2il;

typedef struct _fx_T2iq {
   int_ t0;
   uint64_t t1;
} _fx_T2iq;

typedef struct _fx_T2id {
   int_ t0;
   double t1;
} _fx_T2id;

typedef struct _fx_N10Ast__lit_t {
   int tag;
   union {
      int64_t LitInt;
      struct _fx_T2il LitSInt;
      struct _fx_T2iq LitUInt;
      struct _fx_T2id LitFloat;
      fx_str_t LitString;
      char_ LitChar;
      bool LitBool;
   } u;
} _fx_N10Ast__lit_t;

typedef struct _fx_rNt6option1N10Ast__typ_t_data_t {
   int_ rc;
   struct _fx_Nt6option1N10Ast__typ_t_data_t* data;
} _fx_rNt6option1N10Ast__typ_t_data_t, *_fx_rNt6option1N10Ast__typ_t;

typedef struct _fx_LN10Ast__typ_t_data_t {
   int_ rc;
   struct _fx_LN10Ast__typ_t_data_t* tl;
   struct _fx_N10Ast__typ_t_data_t* hd;
} _fx_LN10Ast__typ_t_data_t, *_fx_LN10Ast__typ_t;

typedef struct _fx_T2LN10Ast__typ_tN10Ast__typ_t {
   struct _fx_LN10Ast__typ_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2LN10Ast__typ_tN10Ast__typ_t;

typedef struct _fx_T2iN10Ast__typ_t {
   int_ t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2iN10Ast__typ_t;

typedef struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t {
   struct _fx_R16Ast__val_flags_t t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_N10Ast__typ_t_data_t* t2;
   struct _fx_N10Ast__exp_t_data_t* t3;
} _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t;

typedef struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* tl;
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t hd;
} _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t, *_fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t;

typedef struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB {
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t0;
   bool t1;
} _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB;

typedef struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t {
   int_ rc;
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB data;
} _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t, *_fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB;

typedef struct _fx_T2LN10Ast__typ_tR9Ast__id_t {
   struct _fx_LN10Ast__typ_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
} _fx_T2LN10Ast__typ_tR9Ast__id_t;

typedef struct _fx_N10Ast__typ_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_rNt6option1N10Ast__typ_t_data_t* TypVar;
      struct _fx_Nt6option1N10Ast__typ_t_data_t* TypVarTuple;
      struct _fx_N10Ast__typ_t_data_t* TypVarArray;
      int_ TypSInt;
      int_ TypUInt;
      int_ TypFloat;
      struct _fx_T2LN10Ast__typ_tN10Ast__typ_t TypFun;
      struct _fx_N10Ast__typ_t_data_t* TypList;
      struct _fx_N10Ast__typ_t_data_t* TypVector;
      struct _fx_LN10Ast__typ_t_data_t* TypTuple;
      struct _fx_N10Ast__typ_t_data_t* TypRef;
      struct _fx_T2iN10Ast__typ_t TypArray;
      struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t* TypRecord;
      struct _fx_T2LN10Ast__typ_tR9Ast__id_t TypApp;
   } u;
} _fx_N10Ast__typ_t_data_t, *_fx_N10Ast__typ_t;

typedef struct _fx_N12Ast__cmpop_t {
   int tag;
} _fx_N12Ast__cmpop_t;

typedef struct _fx_N13Ast__binary_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_N12Ast__cmpop_t OpCmp;
      struct _fx_N12Ast__cmpop_t OpDotCmp;
      struct _fx_N13Ast__binary_t_data_t* OpAugBinary;
   } u;
} _fx_N13Ast__binary_t_data_t, *_fx_N13Ast__binary_t;

typedef struct _fx_N12Ast__unary_t {
   int tag;
} _fx_N12Ast__unary_t;

typedef struct _fx_N12Ast__sctyp_t {
   int tag;
} _fx_N12Ast__sctyp_t;

typedef struct _fx_N13Ast__intrin_t {
   int tag;
   union {
      struct _fx_R9Ast__id_t IntrinMath;
      struct _fx_N12Ast__sctyp_t IntrinSaturate;
   } u;
} _fx_N13Ast__intrin_t;

typedef struct _fx_N15Ast__for_make_t {
   int tag;
} _fx_N15Ast__for_make_t;

typedef struct _fx_R16Ast__for_flags_t {
   bool for_flag_parallel;
   struct _fx_N15Ast__for_make_t for_flag_make;
   bool for_flag_unzip;
   bool for_flag_fold;
   bool for_flag_nested;
} _fx_R16Ast__for_flags_t;

typedef struct _fx_N13Ast__border_t {
   int tag;
} _fx_N13Ast__border_t;

typedef struct _fx_N18Ast__interpolate_t {
   int tag;
} _fx_N18Ast__interpolate_t;

typedef struct _fx_T2BR10Ast__loc_t {
   bool t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2BR10Ast__loc_t;

typedef struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t {
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__typ_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__lit_t t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N13Ast__binary_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N12Ast__unary_t t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_LN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LN10Ast__exp_t_data_t* tl;
   struct _fx_N10Ast__exp_t_data_t* hd;
} _fx_LN10Ast__exp_t_data_t, *_fx_LN10Ast__exp_t;

typedef struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N13Ast__intrin_t t0;
   struct _fx_LN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN10Ast__exp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2R9Ast__id_tN10Ast__exp_t;

typedef struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_LN10Ast__exp_t_data_t* t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_LLN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LLN10Ast__exp_t_data_t* tl;
   struct _fx_LN10Ast__exp_t_data_t* hd;
} _fx_LLN10Ast__exp_t_data_t, *_fx_LLN10Ast__exp_t;

typedef struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_LLN10Ast__exp_t_data_t* t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN10Ast__exp_t hd;
} _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t, *_fx_LT2R9Ast__id_tN10Ast__exp_t;

typedef struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N13Ast__border_t t1;
   struct _fx_N18Ast__interpolate_t t2;
   struct _fx_LN10Ast__exp_t_data_t* t3;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t4;
} _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__exp_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__pat_tN10Ast__exp_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2N10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* tl;
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t hd;
} _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t, *_fx_LT2N10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t {
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_R16Ast__for_flags_t t3;
   struct _fx_R10Ast__loc_t t4;
} _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t;

typedef struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t {
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
} _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t;

typedef struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t {
   int_ rc;
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* tl;
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t hd;
} _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t, *_fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t;

typedef struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R16Ast__for_flags_t t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t {
   fx_str_t t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2ST2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t {
   fx_str_t t0;
   fx_str_t t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3SST2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R16Ast__val_flags_t t2;
   struct _fx_R10Ast__loc_t t3;
} _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t;

typedef struct _fx_T2iR9Ast__id_t {
   int_ t0;
   struct _fx_R9Ast__id_t t1;
} _fx_T2iR9Ast__id_t;

typedef struct _fx_LT2iR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT2iR9Ast__id_t_data_t* tl;
   struct _fx_T2iR9Ast__id_t hd;
} _fx_LT2iR9Ast__id_t_data_t, *_fx_LT2iR9Ast__id_t;

typedef struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t {
   struct _fx_LT2iR9Ast__id_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LT2iR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T3iLR9Ast__id_tR10Ast__loc_t {
   int_ t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3iLR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T2LSR10Ast__loc_t {
   struct _fx_LS_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LSR10Ast__loc_t;

typedef struct _fx_N10Ast__exp_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R10Ast__loc_t ExpNop;
      struct _fx_T2BR10Ast__loc_t ExpBreak;
      struct _fx_R10Ast__loc_t ExpContinue;
      struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t ExpReturn;
      struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpRange;
      struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t ExpLit;
      struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t ExpIdent;
      struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpBinary;
      struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpUnary;
      struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpIntrin;
      struct _fx_T2R9Ast__id_tN10Ast__exp_t ExpSync;
      struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpSeq;
      struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkTuple;
      struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkArray;
      struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkVector;
      struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkRecord;
      struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpUpdateRecord;
      struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpCall;
      struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpAt;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t ExpAssign;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMem;
      struct _fx_T2N10Ast__exp_tR10Ast__loc_t ExpThrow;
      struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpIf;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t ExpWhile;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t ExpDoWhile;
      struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t ExpFor;
      struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t
         ExpMap;
      struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpTryCatch;
      struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMatch;
      struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t ExpCast;
      struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t ExpTyped;
      struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t ExpCCode;
      struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t ExpData;
      struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t DefVal;
      struct _fx_rR13Ast__deffun_t_data_t* DefFun;
      struct _fx_rR13Ast__defexn_t_data_t* DefExn;
      struct _fx_rR13Ast__deftyp_t_data_t* DefTyp;
      struct _fx_rR17Ast__defvariant_t_data_t* DefVariant;
      struct _fx_rR19Ast__definterface_t_data_t* DefInterface;
      struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t DirImport;
      struct _fx_T3iLR9Ast__id_tR10Ast__loc_t DirImportFrom;
      struct _fx_T2LSR10Ast__loc_t DirPragma;
   } u;
} _fx_N10Ast__exp_t_data_t, *_fx_N10Ast__exp_t;

typedef struct _fx_T2N10Ast__lit_tR10Ast__loc_t {
   struct _fx_N10Ast__lit_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__lit_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2R9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T2LN10Ast__pat_tR10Ast__loc_t {
   struct _fx_LN10Ast__pat_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LN10Ast__pat_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN10Ast__pat_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
} _fx_T2R9Ast__id_tN10Ast__pat_t;

typedef struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN10Ast__pat_t hd;
} _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t, *_fx_LT2R9Ast__id_tN10Ast__pat_t;

typedef struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t {
   struct _fx_Nt6option1R9Ast__id_t t0;
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__pat_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_N10Ast__pat_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R10Ast__loc_t PatAny;
      struct _fx_T2N10Ast__lit_tR10Ast__loc_t PatLit;
      struct _fx_T2R9Ast__id_tR10Ast__loc_t PatIdent;
      struct _fx_T2LN10Ast__pat_tR10Ast__loc_t PatTuple;
      struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t PatVariant;
      struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t PatRecord;
      struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t PatCons;
      struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t PatAs;
      struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t PatTyped;
      struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t PatWhen;
      struct _fx_T2LN10Ast__pat_tR10Ast__loc_t PatAlt;
      struct _fx_T2N10Ast__pat_tR10Ast__loc_t PatRef;
   } u;
} _fx_N10Ast__pat_t_data_t, *_fx_N10Ast__pat_t;

typedef struct _fx_N16Ast__env_entry_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R9Ast__id_t EnvId;
      struct _fx_N10Ast__typ_t_data_t* EnvTyp;
   } u;
} _fx_N16Ast__env_entry_t_data_t, *_fx_N16Ast__env_entry_t;

typedef struct _fx_T2SR10Ast__loc_t {
   fx_str_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2SR10Ast__loc_t;

typedef struct _fx_LT2SR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LT2SR10Ast__loc_t_data_t* tl;
   struct _fx_T2SR10Ast__loc_t hd;
} _fx_LT2SR10Ast__loc_t_data_t, *_fx_LT2SR10Ast__loc_t;

typedef struct _fx_R14Ast__pragmas_t {
   bool pragma_cpp;
   struct _fx_LT2SR10Ast__loc_t_data_t* pragma_clibs;
} _fx_R14Ast__pragmas_t;

typedef struct _fx_Li_data_t {
   int_ rc;
   struct _fx_Li_data_t* tl;
   int_ hd;
} _fx_Li_data_t, *_fx_Li;

typedef struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t {
   struct _fx_R9Ast__id_t t0;
   fx_str_t t1;
   int_ t2;
   bool t3;
   struct _fx_LN10Ast__exp_t_data_t* t4;
   struct _fx_Li_data_t* t5;
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t t6;
   bool t7;
   int_ t8;
   struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t* t9;
} _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t;

typedef struct _fx_N16Ast__defmodule_t_data_t {
   int_ rc;
   union {
      struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t
         defmodule_t;
   } u;
} _fx_N16Ast__defmodule_t_data_t, *_fx_N16Ast__defmodule_t;

typedef struct _fx_rRt6Set__t1R9Ast__id_t_data_t {
   int_ rc;
   struct _fx_Rt6Set__t1R9Ast__id_t data;
} _fx_rRt6Set__t1R9Ast__id_t_data_t, *_fx_rRt6Set__t1R9Ast__id_t;

typedef struct _fx_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t1;
} _fx_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t;

typedef struct _fx_Nt6option1N14K_form__kexp_t {
   int tag;
   union {
      struct _fx_N14K_form__kexp_t_data_t* Some;
   } u;
} _fx_Nt6option1N14K_form__kexp_t;

typedef struct _fx_Nt6option1rR23K_form__kdefinterface_t {
   int tag;
   union {
      struct _fx_rR23K_form__kdefinterface_t_data_t* Some;
   } u;
} _fx_Nt6option1rR23K_form__kdefinterface_t;

typedef struct _fx_N14K_form__klit_t {
   int tag;
   union {
      int64_t KLitInt;
      struct _fx_T2il KLitSInt;
      struct _fx_T2iq KLitUInt;
      struct _fx_T2id KLitFloat;
      fx_str_t KLitString;
      char_ KLitChar;
      bool KLitBool;
      struct _fx_N14K_form__ktyp_t_data_t* KLitNil;
   } u;
} _fx_N14K_form__klit_t;

typedef struct _fx_N14K_form__atom_t {
   int tag;
   union {
      struct _fx_R9Ast__id_t AtomId;
      struct _fx_N14K_form__klit_t AtomLit;
   } u;
} _fx_N14K_form__atom_t;

typedef struct _fx_Nt6option1N14K_form__atom_t {
   int tag;
   union {
      struct _fx_N14K_form__atom_t Some;
   } u;
} _fx_Nt6option1N14K_form__atom_t;

typedef struct _fx_LN14K_form__kexp_t_data_t {
   int_ rc;
   struct _fx_LN14K_form__kexp_t_data_t* tl;
   struct _fx_N14K_form__kexp_t_data_t* hd;
} _fx_LN14K_form__kexp_t_data_t, *_fx_LN14K_form__kexp_t;

typedef struct _fx_T2BN14K_form__atom_t {
   bool t0;
   struct _fx_N14K_form__atom_t t1;
} _fx_T2BN14K_form__atom_t;

typedef struct _fx_LT2BN14K_form__atom_t_data_t {
   int_ rc;
   struct _fx_LT2BN14K_form__atom_t_data_t* tl;
   struct _fx_T2BN14K_form__atom_t hd;
} _fx_LT2BN14K_form__atom_t_data_t, *_fx_LT2BN14K_form__atom_t;

typedef struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t {
   struct _fx_LN14K_form__ktyp_t_data_t* t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
} _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t;

typedef struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* t1;
} _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t;

typedef struct _fx_T2iN14K_form__ktyp_t {
   int_ t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
} _fx_T2iN14K_form__ktyp_t;

typedef struct _fx_N14K_form__ktyp_t_data_t {
   int_ rc;
   int tag;
   union {
      int_ KTypSInt;
      int_ KTypUInt;
      int_ KTypFloat;
      struct _fx_N14K_form__ktyp_t_data_t* KTypRawPointer;
      struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t KTypFun;
      struct _fx_LN14K_form__ktyp_t_data_t* KTypTuple;
      struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t KTypRecord;
      struct _fx_R9Ast__id_t KTypName;
      struct _fx_T2iN14K_form__ktyp_t KTypArray;
      struct _fx_N14K_form__ktyp_t_data_t* KTypVector;
      struct _fx_N14K_form__ktyp_t_data_t* KTypList;
      struct _fx_N14K_form__ktyp_t_data_t* KTypRef;
   } u;
} _fx_N14K_form__ktyp_t_data_t, *_fx_N14K_form__ktyp_t;

typedef struct _fx_Ta3N14K_form__atom_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_N14K_form__atom_t t1;
   struct _fx_N14K_form__atom_t t2;
} _fx_Ta3N14K_form__atom_t;

typedef struct _fx_N13K_form__dom_t {
   int tag;
   union {
      struct _fx_N14K_form__atom_t DomainElem;
      struct _fx_N14K_form__atom_t DomainFast;
      struct _fx_Ta3N14K_form__atom_t DomainRange;
   } u;
} _fx_N13K_form__dom_t;

typedef struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t {
   struct _fx_Nt6option1N14K_form__atom_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t;

typedef struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__ktyp_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N13Ast__binary_t_data_t* t0;
   struct _fx_N14K_form__atom_t t1;
   struct _fx_N14K_form__atom_t t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N12Ast__unary_t t0;
   struct _fx_N14K_form__atom_t t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_LN14K_form__atom_t_data_t {
   int_ rc;
   struct _fx_LN14K_form__atom_t_data_t* tl;
   struct _fx_N14K_form__atom_t hd;
} _fx_LN14K_form__atom_t_data_t, *_fx_LN14K_form__atom_t;

typedef struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N13Ast__intrin_t t0;
   struct _fx_LN14K_form__atom_t_data_t* t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN14K_form__kexp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
} _fx_T2R9Ast__id_tN14K_form__kexp_t;

typedef struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LN14K_form__kexp_t_data_t* t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__kexp_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_N14K_form__kexp_t_data_t* t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LN14K_form__atom_t_data_t* t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
   struct _fx_LN14K_form__atom_t_data_t* t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LN14K_form__atom_t_data_t* t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_LN14K_form__atom_t_data_t* t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_LLT2BN14K_form__atom_t_data_t {
   int_ rc;
   struct _fx_LLT2BN14K_form__atom_t_data_t* tl;
   struct _fx_LT2BN14K_form__atom_t_data_t* hd;
} _fx_LLT2BN14K_form__atom_t_data_t, *_fx_LLT2BN14K_form__atom_t;

typedef struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   bool t0;
   struct _fx_LLT2BN14K_form__atom_t_data_t* t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LT2BN14K_form__atom_t_data_t* t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_LN13K_form__dom_t_data_t {
   int_ rc;
   struct _fx_LN13K_form__dom_t_data_t* tl;
   struct _fx_N13K_form__dom_t hd;
} _fx_LN13K_form__dom_t_data_t, *_fx_LN13K_form__dom_t;

typedef struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_N13Ast__border_t t1;
   struct _fx_N18Ast__interpolate_t t2;
   struct _fx_LN13K_form__dom_t_data_t* t3;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t4;
} _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N14K_form__atom_t t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t;

typedef struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t {
   struct _fx_LN14K_form__kexp_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
} _fx_T2LN14K_form__kexp_tN14K_form__kexp_t;

typedef struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t {
   int_ rc;
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* tl;
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t hd;
} _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t, *_fx_LT2LN14K_form__kexp_tN14K_form__kexp_t;

typedef struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__kexp_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tBR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   bool t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3R9Ast__id_tBR10Ast__loc_t;

typedef struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN13K_form__dom_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N13K_form__dom_t t1;
} _fx_T2R9Ast__id_tN13K_form__dom_t;

typedef struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN13K_form__dom_t hd;
} _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t, *_fx_LT2R9Ast__id_tN13K_form__dom_t;

typedef struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t {
   struct _fx_N14K_form__kexp_t_data_t* t0;
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t1;
   struct _fx_LR9Ast__id_t_data_t* t2;
} _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t;

typedef struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* tl;
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t hd;
} _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t, *_fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t;

typedef struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_R16Ast__for_flags_t t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t {
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
   struct _fx_N14K_form__kexp_t_data_t* t2;
   struct _fx_R16Ast__for_flags_t t3;
   struct _fx_R10Ast__loc_t t4;
} _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t;

typedef struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t {
   struct _fx_N14K_form__kexp_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t;

typedef struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t {
   fx_str_t t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t;

typedef struct _fx_N14K_form__kexp_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R10Ast__loc_t KExpNop;
      struct _fx_R10Ast__loc_t KExpBreak;
      struct _fx_R10Ast__loc_t KExpContinue;
      struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t KExpReturn;
      struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpAtom;
      struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpBinary;
      struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpUnary;
      struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpIntrin;
      struct _fx_T2R9Ast__id_tN14K_form__kexp_t KExpSync;
      struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t KExpSeq;
      struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t KExpIf;
      struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpCall;
      struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpICall;
      struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkTuple;
      struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkRecord;
      struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkClosure;
      struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkArray;
      struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkVector;
      struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t
         KExpAt;
      struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t KExpMem;
      struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t KExpAssign;
      struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMatch;
      struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t KExpTryCatch;
      struct _fx_T3R9Ast__id_tBR10Ast__loc_t KExpThrow;
      struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t KExpCast;
      struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t
         KExpMap;
      struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t KExpFor;
      struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t KExpWhile;
      struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t KExpDoWhile;
      struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t KExpCCode;
      struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t KDefVal;
      struct _fx_rR17K_form__kdeffun_t_data_t* KDefFun;
      struct _fx_rR17K_form__kdefexn_t_data_t* KDefExn;
      struct _fx_rR21K_form__kdefvariant_t_data_t* KDefVariant;
      struct _fx_rR23K_form__kdefinterface_t_data_t* KDefInterface;
      struct _fx_rR17K_form__kdeftyp_t_data_t* KDefTyp;
      struct _fx_rR25K_form__kdefclosurevars_t_data_t* KDefClosureVars;
   } u;
} _fx_N14K_form__kexp_t_data_t, *_fx_N14K_form__kexp_t;

typedef struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2N14K_form__atom_tLN14K_form__kexp_t;

typedef struct _fx_T2R9Ast__id_tLN14K_form__kexp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2R9Ast__id_tLN14K_form__kexp_t;

typedef struct _fx_R17K_form__kmodule_t {
   struct _fx_R9Ast__id_t km_name;
   int_ km_idx;
   int_ km_toposort_idx;
   fx_str_t km_cname;
   struct _fx_LN14K_form__kexp_t_data_t* km_top;
   struct _fx_Li_data_t* km_deps;
   bool km_skip;
   bool km_main;
   struct _fx_R14Ast__pragmas_t km_pragmas;
} _fx_R17K_form__kmodule_t;

typedef struct _fx_LR17K_form__kmodule_t_data_t {
   int_ rc;
   struct _fx_LR17K_form__kmodule_t_data_t* tl;
   struct _fx_R17K_form__kmodule_t hd;
} _fx_LR17K_form__kmodule_t_data_t, *_fx_LR17K_form__kmodule_t;

typedef struct _fx_R23K_normalize__pat_info_t {
   struct _fx_N10Ast__pat_t_data_t* pinfo_p;
   struct _fx_N14K_form__ktyp_t_data_t* pinfo_typ;
   struct _fx_N14K_form__kexp_t_data_t* pinfo_e;
   struct _fx_R9Ast__id_t pinfo_tag;
} _fx_R23K_normalize__pat_info_t;

typedef struct _fx_Nt6option1R23K_normalize__pat_info_t {
   int tag;
   union {
      struct _fx_R23K_normalize__pat_info_t Some;
   } u;
} _fx_Nt6option1R23K_normalize__pat_info_t;

typedef struct _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t {
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t t0;
   int_ t1;
   struct _fx_R9Ast__id_t t2;
} _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t;

typedef struct _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t {
   int tag;
   union {
      struct _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t Some;
   } u;
} _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t;

typedef struct _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t {
   int tag;
   union {
      struct _fx_T2R9Ast__id_tN10Ast__exp_t Some;
   } u;
} _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t;

typedef struct _fx_LR23K_normalize__pat_info_t_data_t {
   int_ rc;
   struct _fx_LR23K_normalize__pat_info_t_data_t* tl;
   struct _fx_R23K_normalize__pat_info_t hd;
} _fx_LR23K_normalize__pat_info_t_data_t, *_fx_LR23K_normalize__pat_info_t;

typedef struct _fx_T2N14K_form__atom_ti {
   struct _fx_N14K_form__atom_t t0;
   int_ t1;
} _fx_T2N14K_form__atom_ti;

typedef struct _fx_LT2N14K_form__atom_ti_data_t {
   int_ rc;
   struct _fx_LT2N14K_form__atom_ti_data_t* tl;
   struct _fx_T2N14K_form__atom_ti hd;
} _fx_LT2N14K_form__atom_ti_data_t, *_fx_LT2N14K_form__atom_ti;

typedef struct _fx_T2Nt11Set__tree_t1R9Ast__id_ti {
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t0;
   int_ t1;
} _fx_T2Nt11Set__tree_t1R9Ast__id_ti;

typedef struct _fx_T2Nt11Set__tree_t1R9Ast__id_tB {
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t0;
   bool t1;
} _fx_T2Nt11Set__tree_t1R9Ast__id_tB;

typedef struct _fx_T3Nt11Set__tree_t1R9Ast__id_tBi {
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t0;
   bool t1;
   int_ t2;
} _fx_T3Nt11Set__tree_t1R9Ast__id_tBi;

typedef struct _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB {
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
   bool t2;
} _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB;

typedef struct _fx_FPS1R9Ast__id_t {
   int (*fp)(struct _fx_R9Ast__id_t*, fx_str_t*, void*);
   fx_fcv_t* fcv;
} _fx_FPS1R9Ast__id_t;

typedef struct _fx_T2N14K_form__kexp_tLN14K_form__kexp_t {
   struct _fx_N14K_form__kexp_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2N14K_form__kexp_tLN14K_form__kexp_t;

typedef struct _fx_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t {
   struct _fx_Nt6option1N14K_form__atom_t t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t;

typedef struct _fx_T2LN14K_form__atom_tLN14K_form__kexp_t {
   struct _fx_LN14K_form__atom_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2LN14K_form__atom_tLN14K_form__kexp_t;

typedef struct _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t {
   struct _fx_LN14K_form__kexp_t_data_t* t0;
   struct _fx_LT2SR10Ast__loc_t_data_t* t1;
} _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t;

typedef struct _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB {
   struct _fx_LLT2BN14K_form__atom_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
   bool t2;
} _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB;

typedef struct _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB {
   struct _fx_LT2BN14K_form__atom_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
   bool t2;
} _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB;

typedef struct _fx_T3BN10Ast__exp_tB {
   bool t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   bool t2;
} _fx_T3BN10Ast__exp_tB;

typedef struct _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t {
   struct _fx_LT2BN14K_form__atom_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t;

typedef struct _fx_T2BN10Ast__exp_t {
   bool t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2BN10Ast__exp_t;

typedef struct _fx_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t2;
} _fx_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t;

typedef struct _fx_T2LN10Ast__exp_tNt6option1N10Ast__exp_t {
   struct _fx_LN10Ast__exp_t_data_t* t0;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1;
} _fx_T2LN10Ast__exp_tNt6option1N10Ast__exp_t;

typedef struct _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t {
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
   struct _fx_LN14K_form__kexp_t_data_t* t2;
   struct _fx_LN14K_form__kexp_t_data_t* t3;
} _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t;

typedef struct _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t {
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t;

typedef struct _fx_T2LN13K_form__dom_tLN14K_form__kexp_t {
   struct _fx_LN13K_form__dom_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2LN13K_form__dom_tLN14K_form__kexp_t;

typedef struct _fx_T2N13K_form__dom_tLN14K_form__kexp_t {
   struct _fx_N13K_form__dom_t t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2N13K_form__dom_tLN14K_form__kexp_t;

typedef struct _fx_T4R9Ast__id_tiN14K_form__ktyp_tB {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
   struct _fx_N14K_form__ktyp_t_data_t* t2;
   bool t3;
} _fx_T4R9Ast__id_tiN14K_form__ktyp_tB;

typedef struct _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t {
   struct _fx_T4R9Ast__id_tiN14K_form__ktyp_tB t0;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* t1;
} _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t;

typedef struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t {
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t;

typedef struct _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t {
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
   struct _fx_LN14K_form__kexp_t_data_t* t2;
} _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t;

typedef struct _fx_T2LR9Ast__id_tLN14K_form__kexp_t {
   struct _fx_LR9Ast__id_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2LR9Ast__id_tLN14K_form__kexp_t;

typedef struct _fx_T2LR9Ast__id_tLN14K_form__ktyp_t {
   struct _fx_LR9Ast__id_t_data_t* t0;
   struct _fx_LN14K_form__ktyp_t_data_t* t1;
} _fx_T2LR9Ast__id_tLN14K_form__ktyp_t;

typedef struct _fx_rLT2SR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LT2SR10Ast__loc_t_data_t* data;
} _fx_rLT2SR10Ast__loc_t_data_t, *_fx_rLT2SR10Ast__loc_t;

typedef struct _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
   struct _fx_N14K_form__ktyp_t_data_t* t2;
   bool t3;
   bool t4;
} _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB;

typedef struct _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_N14K_form__ktyp_t_data_t* t2;
   int_ t3;
} _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti;

typedef struct _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti_data_t {
   int_ rc;
   struct _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti_data_t* tl;
   struct _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti hd;
} _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti_data_t, *_fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti;

typedef struct _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti {
   struct _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB t0;
   struct _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti_data_t* t1;
} _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti;

typedef struct _fx_T3R9Ast__id_tiN14K_form__ktyp_t {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
   struct _fx_N14K_form__ktyp_t_data_t* t2;
} _fx_T3R9Ast__id_tiN14K_form__ktyp_t;

typedef struct _fx_T2N10Ast__pat_tN14K_form__ktyp_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
} _fx_T2N10Ast__pat_tN14K_form__ktyp_t;

typedef struct _fx_LT2N10Ast__pat_tN14K_form__ktyp_t_data_t {
   int_ rc;
   struct _fx_LT2N10Ast__pat_tN14K_form__ktyp_t_data_t* tl;
   struct _fx_T2N10Ast__pat_tN14K_form__ktyp_t hd;
} _fx_LT2N10Ast__pat_tN14K_form__ktyp_t_data_t, *_fx_LT2N10Ast__pat_tN14K_form__ktyp_t;

typedef struct _fx_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t {
   struct _fx_T3R9Ast__id_tiN14K_form__ktyp_t t0;
   struct _fx_LT2N10Ast__pat_tN14K_form__ktyp_t_data_t* t1;
} _fx_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t;

typedef struct _fx_T4N10Ast__pat_tR9Ast__id_tBB {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
   bool t2;
   bool t3;
} _fx_T4N10Ast__pat_tR9Ast__id_tBB;

typedef struct _fx_T2LN14K_form__atom_tB {
   struct _fx_LN14K_form__atom_t_data_t* t0;
   bool t1;
} _fx_T2LN14K_form__atom_tB;

typedef struct _fx_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_LN14K_form__kexp_t_data_t* t2;
} _fx_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t;

typedef struct _fx_Ta3LR23K_normalize__pat_info_t {
   struct _fx_LR23K_normalize__pat_info_t_data_t* t0;
   struct _fx_LR23K_normalize__pat_info_t_data_t* t1;
   struct _fx_LR23K_normalize__pat_info_t_data_t* t2;
} _fx_Ta3LR23K_normalize__pat_info_t;

typedef struct _fx_T3N10Ast__pat_tN14K_form__ktyp_ti {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
   int_ t2;
} _fx_T3N10Ast__pat_tN14K_form__ktyp_ti;

typedef struct _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti_data_t {
   int_ rc;
   struct _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti_data_t* tl;
   struct _fx_T3N10Ast__pat_tN14K_form__ktyp_ti hd;
} _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti_data_t, *_fx_LT3N10Ast__pat_tN14K_form__ktyp_ti;

typedef struct _fx_Ta2LN14K_form__kexp_t {
   struct _fx_LN14K_form__kexp_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_Ta2LN14K_form__kexp_t;

typedef struct _fx_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t {
   struct _fx_Nt6option1R23K_normalize__pat_info_t t0;
   struct _fx_Ta3LR23K_normalize__pat_info_t t1;
} _fx_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t;

typedef struct _fx_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t {
   struct _fx_Ta3LR23K_normalize__pat_info_t t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
   struct _fx_LN14K_form__kexp_t_data_t* t2;
} _fx_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t;

typedef struct _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LN14K_form__ktyp_t_data_t* t1;
   struct _fx_LN14K_form__kexp_t_data_t* t2;
   struct _fx_LN14K_form__kexp_t_data_t* t3;
   struct _fx_Nt6option1N14K_form__kexp_t t4;
} _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t;

typedef struct _fx_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t {
   struct _fx_LN14K_form__ktyp_t_data_t* t0;
   struct _fx_N14K_form__atom_t t1;
   struct _fx_N14K_form__atom_t t2;
} _fx_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t;

typedef struct _fx_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
   struct _fx_Nt6option1N14K_form__kexp_t t2;
} _fx_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t;

typedef struct _fx_T2BN14K_form__ktyp_t {
   bool t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
} _fx_T2BN14K_form__ktyp_t;

typedef struct _fx_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t {
   struct _fx_LN10Ast__pat_t_data_t* t0;
   struct _fx_LN14K_form__ktyp_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
} _fx_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t;

typedef struct _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t {
   struct _fx_LN10Ast__pat_t_data_t* t0;
   struct _fx_LN14K_form__ktyp_t_data_t* t1;
} _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t;

typedef struct _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t {
   struct _fx_N16Ast__defmodule_t_data_t* t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t;

typedef struct _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t_data_t {
   int_ rc;
   struct _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t_data_t* tl;
   struct _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t hd;
} _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t_data_t, *_fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t;

typedef struct {
   int_ rc;
   int_ data;
} _fx_E4Exit_data_t;

typedef struct {
   int_ rc;
   fx_str_t data;
} _fx_E4Fail_data_t;

typedef struct {
   int_ rc;
   struct _fx_T2Ta2iS data;
} _fx_E22LexerUtils__LexerError_data_t;

typedef struct {
   int_ rc;
   struct _fx_T2R10Ast__loc_tS data;
} _fx_E17Ast__CompileError_data_t;

typedef struct {
   int_ rc;
   struct _fx_T2R10Ast__loc_tS data;
} _fx_E18Parser__ParseError_data_t;

static void _fx_free_Nt6option1N10Ast__typ_t(struct _fx_Nt6option1N10Ast__typ_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_N10Ast__typ_t(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_LS(struct _fx_LS_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LS, fx_free_str);
}

static int _fx_cons_LS(fx_str_t* hd, struct _fx_LS_data_t* tl, bool addref_tl, struct _fx_LS_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LS, fx_copy_str);
}

static void _fx_free_T2Ta2iS(struct _fx_T2Ta2iS* dst)
{
   fx_free_str(&dst->t1);
}

static void _fx_copy_T2Ta2iS(struct _fx_T2Ta2iS* src, struct _fx_T2Ta2iS* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_T2Ta2iS(struct _fx_Ta2i* t0, fx_str_t* t1, struct _fx_T2Ta2iS* fx_result)
{
   fx_result->t0 = *t0;
   fx_copy_str(t1, &fx_result->t1);
}

static int _fx_cons_LN12Ast__scope_t(
   struct _fx_N12Ast__scope_t* hd,
   struct _fx_LN12Ast__scope_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN12Ast__scope_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN12Ast__scope_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_R16Ast__val_flags_t(struct _fx_R16Ast__val_flags_t* dst)
{
   fx_free_list_simple(&dst->val_flag_global);
}

static void _fx_copy_R16Ast__val_flags_t(struct _fx_R16Ast__val_flags_t* src, struct _fx_R16Ast__val_flags_t* dst)
{
   dst->val_flag_arg = src->val_flag_arg;
   dst->val_flag_mutable = src->val_flag_mutable;
   dst->val_flag_temp = src->val_flag_temp;
   dst->val_flag_tempref = src->val_flag_tempref;
   dst->val_flag_private = src->val_flag_private;
   dst->val_flag_subarray = src->val_flag_subarray;
   dst->val_flag_instance = src->val_flag_instance;
   dst->val_flag_method = src->val_flag_method;
   dst->val_flag_ctor = src->val_flag_ctor;
   FX_COPY_PTR(src->val_flag_global, &dst->val_flag_global);
}

static void _fx_make_R16Ast__val_flags_t(
   bool r_val_flag_arg,
   bool r_val_flag_mutable,
   bool r_val_flag_temp,
   bool r_val_flag_tempref,
   bool r_val_flag_private,
   bool r_val_flag_subarray,
   bool r_val_flag_instance,
   struct _fx_T2R9Ast__id_ti* r_val_flag_method,
   int_ r_val_flag_ctor,
   struct _fx_LN12Ast__scope_t_data_t* r_val_flag_global,
   struct _fx_R16Ast__val_flags_t* fx_result)
{
   fx_result->val_flag_arg = r_val_flag_arg;
   fx_result->val_flag_mutable = r_val_flag_mutable;
   fx_result->val_flag_temp = r_val_flag_temp;
   fx_result->val_flag_tempref = r_val_flag_tempref;
   fx_result->val_flag_private = r_val_flag_private;
   fx_result->val_flag_subarray = r_val_flag_subarray;
   fx_result->val_flag_instance = r_val_flag_instance;
   fx_result->val_flag_method = *r_val_flag_method;
   fx_result->val_flag_ctor = r_val_flag_ctor;
   FX_COPY_PTR(r_val_flag_global, &fx_result->val_flag_global);
}

static int _fx_cons_LR9Ast__id_t(
   struct _fx_R9Ast__id_t* hd,
   struct _fx_LR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LR9Ast__id_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_R17K_form__kdefval_t(struct _fx_R17K_form__kdefval_t* dst)
{
   fx_free_str(&dst->kv_cname);
   _fx_free_N14K_form__ktyp_t(&dst->kv_typ);
   _fx_free_R16Ast__val_flags_t(&dst->kv_flags);
}

static void _fx_copy_R17K_form__kdefval_t(struct _fx_R17K_form__kdefval_t* src, struct _fx_R17K_form__kdefval_t* dst)
{
   dst->kv_name = src->kv_name;
   fx_copy_str(&src->kv_cname, &dst->kv_cname);
   FX_COPY_PTR(src->kv_typ, &dst->kv_typ);
   _fx_copy_R16Ast__val_flags_t(&src->kv_flags, &dst->kv_flags);
   dst->kv_loc = src->kv_loc;
}

static void _fx_make_R17K_form__kdefval_t(
   struct _fx_R9Ast__id_t* r_kv_name,
   fx_str_t* r_kv_cname,
   struct _fx_N14K_form__ktyp_t_data_t* r_kv_typ,
   struct _fx_R16Ast__val_flags_t* r_kv_flags,
   struct _fx_R10Ast__loc_t* r_kv_loc,
   struct _fx_R17K_form__kdefval_t* fx_result)
{
   fx_result->kv_name = *r_kv_name;
   fx_copy_str(r_kv_cname, &fx_result->kv_cname);
   FX_COPY_PTR(r_kv_typ, &fx_result->kv_typ);
   _fx_copy_R16Ast__val_flags_t(r_kv_flags, &fx_result->kv_flags);
   fx_result->kv_loc = *r_kv_loc;
}

static void _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* src,
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN14K_form__ktyp_t, _fx_free_T2R9Ast__id_tN14K_form__ktyp_t);
}

static int _fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* hd,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN14K_form__ktyp_t, _fx_copy_T2R9Ast__id_tN14K_form__ktyp_t);
}

static void _fx_free_R23K_form__kdefinterface_t(struct _fx_R23K_form__kdefinterface_t* dst)
{
   fx_free_str(&dst->ki_cname);
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->ki_all_methods);
   fx_free_list_simple(&dst->ki_scope);
}

static void _fx_copy_R23K_form__kdefinterface_t(
   struct _fx_R23K_form__kdefinterface_t* src,
   struct _fx_R23K_form__kdefinterface_t* dst)
{
   dst->ki_name = src->ki_name;
   dst->ki_base = src->ki_base;
   fx_copy_str(&src->ki_cname, &dst->ki_cname);
   dst->ki_id = src->ki_id;
   FX_COPY_PTR(src->ki_all_methods, &dst->ki_all_methods);
   FX_COPY_PTR(src->ki_scope, &dst->ki_scope);
   dst->ki_loc = src->ki_loc;
}

static void _fx_make_R23K_form__kdefinterface_t(
   struct _fx_R9Ast__id_t* r_ki_name,
   struct _fx_R9Ast__id_t* r_ki_base,
   fx_str_t* r_ki_cname,
   struct _fx_R9Ast__id_t* r_ki_id,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* r_ki_all_methods,
   struct _fx_LN12Ast__scope_t_data_t* r_ki_scope,
   struct _fx_R10Ast__loc_t* r_ki_loc,
   struct _fx_R23K_form__kdefinterface_t* fx_result)
{
   fx_result->ki_name = *r_ki_name;
   fx_result->ki_base = *r_ki_base;
   fx_copy_str(r_ki_cname, &fx_result->ki_cname);
   fx_result->ki_id = *r_ki_id;
   FX_COPY_PTR(r_ki_all_methods, &fx_result->ki_all_methods);
   FX_COPY_PTR(r_ki_scope, &fx_result->ki_scope);
   fx_result->ki_loc = *r_ki_loc;
}

static void _fx_free_rR23K_form__kdefinterface_t(struct _fx_rR23K_form__kdefinterface_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR23K_form__kdefinterface_t, _fx_free_R23K_form__kdefinterface_t);
}

static int _fx_make_rR23K_form__kdefinterface_t(
   struct _fx_R23K_form__kdefinterface_t* arg,
   struct _fx_rR23K_form__kdefinterface_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR23K_form__kdefinterface_t, _fx_copy_R23K_form__kdefinterface_t);
}

static void _fx_free_R17K_form__kdeffun_t(struct _fx_R17K_form__kdeffun_t* dst)
{
   fx_free_str(&dst->kf_cname);
   fx_free_list_simple(&dst->kf_params);
   _fx_free_N14K_form__ktyp_t(&dst->kf_rt);
   _fx_free_N14K_form__kexp_t(&dst->kf_body);
   fx_free_list_simple(&dst->kf_scope);
}

static void _fx_copy_R17K_form__kdeffun_t(struct _fx_R17K_form__kdeffun_t* src, struct _fx_R17K_form__kdeffun_t* dst)
{
   dst->kf_name = src->kf_name;
   fx_copy_str(&src->kf_cname, &dst->kf_cname);
   FX_COPY_PTR(src->kf_params, &dst->kf_params);
   FX_COPY_PTR(src->kf_rt, &dst->kf_rt);
   FX_COPY_PTR(src->kf_body, &dst->kf_body);
   dst->kf_flags = src->kf_flags;
   dst->kf_closure = src->kf_closure;
   FX_COPY_PTR(src->kf_scope, &dst->kf_scope);
   dst->kf_loc = src->kf_loc;
}

static void _fx_make_R17K_form__kdeffun_t(
   struct _fx_R9Ast__id_t* r_kf_name,
   fx_str_t* r_kf_cname,
   struct _fx_LR9Ast__id_t_data_t* r_kf_params,
   struct _fx_N14K_form__ktyp_t_data_t* r_kf_rt,
   struct _fx_N14K_form__kexp_t_data_t* r_kf_body,
   struct _fx_R16Ast__fun_flags_t* r_kf_flags,
   struct _fx_R25K_form__kdefclosureinfo_t* r_kf_closure,
   struct _fx_LN12Ast__scope_t_data_t* r_kf_scope,
   struct _fx_R10Ast__loc_t* r_kf_loc,
   struct _fx_R17K_form__kdeffun_t* fx_result)
{
   fx_result->kf_name = *r_kf_name;
   fx_copy_str(r_kf_cname, &fx_result->kf_cname);
   FX_COPY_PTR(r_kf_params, &fx_result->kf_params);
   FX_COPY_PTR(r_kf_rt, &fx_result->kf_rt);
   FX_COPY_PTR(r_kf_body, &fx_result->kf_body);
   fx_result->kf_flags = *r_kf_flags;
   fx_result->kf_closure = *r_kf_closure;
   FX_COPY_PTR(r_kf_scope, &fx_result->kf_scope);
   fx_result->kf_loc = *r_kf_loc;
}

static void _fx_free_rR17K_form__kdeffun_t(struct _fx_rR17K_form__kdeffun_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR17K_form__kdeffun_t, _fx_free_R17K_form__kdeffun_t);
}

static int _fx_make_rR17K_form__kdeffun_t(
   struct _fx_R17K_form__kdeffun_t* arg,
   struct _fx_rR17K_form__kdeffun_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR17K_form__kdeffun_t, _fx_copy_R17K_form__kdeffun_t);
}

static void _fx_free_R17K_form__kdefexn_t(struct _fx_R17K_form__kdefexn_t* dst)
{
   fx_free_str(&dst->ke_cname);
   fx_free_str(&dst->ke_base_cname);
   _fx_free_N14K_form__ktyp_t(&dst->ke_typ);
   fx_free_list_simple(&dst->ke_scope);
}

static void _fx_copy_R17K_form__kdefexn_t(struct _fx_R17K_form__kdefexn_t* src, struct _fx_R17K_form__kdefexn_t* dst)
{
   dst->ke_name = src->ke_name;
   fx_copy_str(&src->ke_cname, &dst->ke_cname);
   fx_copy_str(&src->ke_base_cname, &dst->ke_base_cname);
   FX_COPY_PTR(src->ke_typ, &dst->ke_typ);
   dst->ke_std = src->ke_std;
   dst->ke_tag = src->ke_tag;
   dst->ke_make = src->ke_make;
   FX_COPY_PTR(src->ke_scope, &dst->ke_scope);
   dst->ke_loc = src->ke_loc;
}

static void _fx_make_R17K_form__kdefexn_t(
   struct _fx_R9Ast__id_t* r_ke_name,
   fx_str_t* r_ke_cname,
   fx_str_t* r_ke_base_cname,
   struct _fx_N14K_form__ktyp_t_data_t* r_ke_typ,
   bool r_ke_std,
   struct _fx_R9Ast__id_t* r_ke_tag,
   struct _fx_R9Ast__id_t* r_ke_make,
   struct _fx_LN12Ast__scope_t_data_t* r_ke_scope,
   struct _fx_R10Ast__loc_t* r_ke_loc,
   struct _fx_R17K_form__kdefexn_t* fx_result)
{
   fx_result->ke_name = *r_ke_name;
   fx_copy_str(r_ke_cname, &fx_result->ke_cname);
   fx_copy_str(r_ke_base_cname, &fx_result->ke_base_cname);
   FX_COPY_PTR(r_ke_typ, &fx_result->ke_typ);
   fx_result->ke_std = r_ke_std;
   fx_result->ke_tag = *r_ke_tag;
   fx_result->ke_make = *r_ke_make;
   FX_COPY_PTR(r_ke_scope, &fx_result->ke_scope);
   fx_result->ke_loc = *r_ke_loc;
}

static void _fx_free_rR17K_form__kdefexn_t(struct _fx_rR17K_form__kdefexn_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR17K_form__kdefexn_t, _fx_free_R17K_form__kdefexn_t);
}

static int _fx_make_rR17K_form__kdefexn_t(
   struct _fx_R17K_form__kdefexn_t* arg,
   struct _fx_rR17K_form__kdefexn_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR17K_form__kdefexn_t, _fx_copy_R17K_form__kdefexn_t);
}

static void _fx_free_LN14K_form__ktyp_t(struct _fx_LN14K_form__ktyp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN14K_form__ktyp_t, _fx_free_N14K_form__ktyp_t);
}

static int _fx_cons_LN14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* hd,
   struct _fx_LN14K_form__ktyp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN14K_form__ktyp_t, FX_COPY_PTR);
}

static void _fx_free_T2R9Ast__id_tLR9Ast__id_t(struct _fx_T2R9Ast__id_tLR9Ast__id_t* dst)
{
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLR9Ast__id_t(
   struct _fx_T2R9Ast__id_tLR9Ast__id_t* src,
   struct _fx_T2R9Ast__id_tLR9Ast__id_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLR9Ast__id_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLR9Ast__id_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tLR9Ast__id_t(struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tLR9Ast__id_t, _fx_free_T2R9Ast__id_tLR9Ast__id_t);
}

static int _fx_cons_LT2R9Ast__id_tLR9Ast__id_t(
   struct _fx_T2R9Ast__id_tLR9Ast__id_t* hd,
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tLR9Ast__id_t, _fx_copy_T2R9Ast__id_tLR9Ast__id_t);
}

static void _fx_free_R21K_form__kdefvariant_t(struct _fx_R21K_form__kdefvariant_t* dst)
{
   fx_free_str(&dst->kvar_cname);
   _fx_free_LN14K_form__ktyp_t(&dst->kvar_targs);
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->kvar_cases);
   fx_free_list_simple(&dst->kvar_ctors);
   _fx_free_LT2R9Ast__id_tLR9Ast__id_t(&dst->kvar_ifaces);
   fx_free_list_simple(&dst->kvar_scope);
}

static void _fx_copy_R21K_form__kdefvariant_t(
   struct _fx_R21K_form__kdefvariant_t* src,
   struct _fx_R21K_form__kdefvariant_t* dst)
{
   dst->kvar_name = src->kvar_name;
   fx_copy_str(&src->kvar_cname, &dst->kvar_cname);
   dst->kvar_proto = src->kvar_proto;
   dst->kvar_props = src->kvar_props;
   FX_COPY_PTR(src->kvar_targs, &dst->kvar_targs);
   FX_COPY_PTR(src->kvar_cases, &dst->kvar_cases);
   FX_COPY_PTR(src->kvar_ctors, &dst->kvar_ctors);
   dst->kvar_flags = src->kvar_flags;
   FX_COPY_PTR(src->kvar_ifaces, &dst->kvar_ifaces);
   FX_COPY_PTR(src->kvar_scope, &dst->kvar_scope);
   dst->kvar_loc = src->kvar_loc;
}

static void _fx_make_R21K_form__kdefvariant_t(
   struct _fx_R9Ast__id_t* r_kvar_name,
   fx_str_t* r_kvar_cname,
   struct _fx_R9Ast__id_t* r_kvar_proto,
   struct _fx_Nt6option1R17K_form__ktprops_t* r_kvar_props,
   struct _fx_LN14K_form__ktyp_t_data_t* r_kvar_targs,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* r_kvar_cases,
   struct _fx_LR9Ast__id_t_data_t* r_kvar_ctors,
   struct _fx_R16Ast__var_flags_t* r_kvar_flags,
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t* r_kvar_ifaces,
   struct _fx_LN12Ast__scope_t_data_t* r_kvar_scope,
   struct _fx_R10Ast__loc_t* r_kvar_loc,
   struct _fx_R21K_form__kdefvariant_t* fx_result)
{
   fx_result->kvar_name = *r_kvar_name;
   fx_copy_str(r_kvar_cname, &fx_result->kvar_cname);
   fx_result->kvar_proto = *r_kvar_proto;
   fx_result->kvar_props = *r_kvar_props;
   FX_COPY_PTR(r_kvar_targs, &fx_result->kvar_targs);
   FX_COPY_PTR(r_kvar_cases, &fx_result->kvar_cases);
   FX_COPY_PTR(r_kvar_ctors, &fx_result->kvar_ctors);
   fx_result->kvar_flags = *r_kvar_flags;
   FX_COPY_PTR(r_kvar_ifaces, &fx_result->kvar_ifaces);
   FX_COPY_PTR(r_kvar_scope, &fx_result->kvar_scope);
   fx_result->kvar_loc = *r_kvar_loc;
}

static void _fx_free_rR21K_form__kdefvariant_t(struct _fx_rR21K_form__kdefvariant_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR21K_form__kdefvariant_t, _fx_free_R21K_form__kdefvariant_t);
}

static int _fx_make_rR21K_form__kdefvariant_t(
   struct _fx_R21K_form__kdefvariant_t* arg,
   struct _fx_rR21K_form__kdefvariant_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR21K_form__kdefvariant_t, _fx_copy_R21K_form__kdefvariant_t);
}

static void _fx_free_R17K_form__kdeftyp_t(struct _fx_R17K_form__kdeftyp_t* dst)
{
   fx_free_str(&dst->kt_cname);
   _fx_free_LN14K_form__ktyp_t(&dst->kt_targs);
   _fx_free_N14K_form__ktyp_t(&dst->kt_typ);
   fx_free_list_simple(&dst->kt_scope);
}

static void _fx_copy_R17K_form__kdeftyp_t(struct _fx_R17K_form__kdeftyp_t* src, struct _fx_R17K_form__kdeftyp_t* dst)
{
   dst->kt_name = src->kt_name;
   fx_copy_str(&src->kt_cname, &dst->kt_cname);
   dst->kt_proto = src->kt_proto;
   dst->kt_props = src->kt_props;
   FX_COPY_PTR(src->kt_targs, &dst->kt_targs);
   FX_COPY_PTR(src->kt_typ, &dst->kt_typ);
   FX_COPY_PTR(src->kt_scope, &dst->kt_scope);
   dst->kt_loc = src->kt_loc;
}

static void _fx_make_R17K_form__kdeftyp_t(
   struct _fx_R9Ast__id_t* r_kt_name,
   fx_str_t* r_kt_cname,
   struct _fx_R9Ast__id_t* r_kt_proto,
   struct _fx_Nt6option1R17K_form__ktprops_t* r_kt_props,
   struct _fx_LN14K_form__ktyp_t_data_t* r_kt_targs,
   struct _fx_N14K_form__ktyp_t_data_t* r_kt_typ,
   struct _fx_LN12Ast__scope_t_data_t* r_kt_scope,
   struct _fx_R10Ast__loc_t* r_kt_loc,
   struct _fx_R17K_form__kdeftyp_t* fx_result)
{
   fx_result->kt_name = *r_kt_name;
   fx_copy_str(r_kt_cname, &fx_result->kt_cname);
   fx_result->kt_proto = *r_kt_proto;
   fx_result->kt_props = *r_kt_props;
   FX_COPY_PTR(r_kt_targs, &fx_result->kt_targs);
   FX_COPY_PTR(r_kt_typ, &fx_result->kt_typ);
   FX_COPY_PTR(r_kt_scope, &fx_result->kt_scope);
   fx_result->kt_loc = *r_kt_loc;
}

static void _fx_free_rR17K_form__kdeftyp_t(struct _fx_rR17K_form__kdeftyp_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR17K_form__kdeftyp_t, _fx_free_R17K_form__kdeftyp_t);
}

static int _fx_make_rR17K_form__kdeftyp_t(
   struct _fx_R17K_form__kdeftyp_t* arg,
   struct _fx_rR17K_form__kdeftyp_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR17K_form__kdeftyp_t, _fx_copy_R17K_form__kdeftyp_t);
}

static void _fx_free_R25K_form__kdefclosurevars_t(struct _fx_R25K_form__kdefclosurevars_t* dst)
{
   fx_free_str(&dst->kcv_cname);
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->kcv_freevars);
   fx_free_list_simple(&dst->kcv_orig_freevars);
   fx_free_list_simple(&dst->kcv_scope);
}

static void _fx_copy_R25K_form__kdefclosurevars_t(
   struct _fx_R25K_form__kdefclosurevars_t* src,
   struct _fx_R25K_form__kdefclosurevars_t* dst)
{
   dst->kcv_name = src->kcv_name;
   fx_copy_str(&src->kcv_cname, &dst->kcv_cname);
   FX_COPY_PTR(src->kcv_freevars, &dst->kcv_freevars);
   FX_COPY_PTR(src->kcv_orig_freevars, &dst->kcv_orig_freevars);
   FX_COPY_PTR(src->kcv_scope, &dst->kcv_scope);
   dst->kcv_loc = src->kcv_loc;
}

static void _fx_make_R25K_form__kdefclosurevars_t(
   struct _fx_R9Ast__id_t* r_kcv_name,
   fx_str_t* r_kcv_cname,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* r_kcv_freevars,
   struct _fx_LR9Ast__id_t_data_t* r_kcv_orig_freevars,
   struct _fx_LN12Ast__scope_t_data_t* r_kcv_scope,
   struct _fx_R10Ast__loc_t* r_kcv_loc,
   struct _fx_R25K_form__kdefclosurevars_t* fx_result)
{
   fx_result->kcv_name = *r_kcv_name;
   fx_copy_str(r_kcv_cname, &fx_result->kcv_cname);
   FX_COPY_PTR(r_kcv_freevars, &fx_result->kcv_freevars);
   FX_COPY_PTR(r_kcv_orig_freevars, &fx_result->kcv_orig_freevars);
   FX_COPY_PTR(r_kcv_scope, &fx_result->kcv_scope);
   fx_result->kcv_loc = *r_kcv_loc;
}

static void _fx_free_rR25K_form__kdefclosurevars_t(struct _fx_rR25K_form__kdefclosurevars_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR25K_form__kdefclosurevars_t, _fx_free_R25K_form__kdefclosurevars_t);
}

static int _fx_make_rR25K_form__kdefclosurevars_t(
   struct _fx_R25K_form__kdefclosurevars_t* arg,
   struct _fx_rR25K_form__kdefclosurevars_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR25K_form__kdefclosurevars_t, _fx_copy_R25K_form__kdefclosurevars_t);
}

static void _fx_free_N15K_form__kinfo_t(struct _fx_N15K_form__kinfo_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_R17K_form__kdefval_t(&dst->u.KVal); break;
   case 3:
      _fx_free_rR17K_form__kdeffun_t(&dst->u.KFun); break;
   case 4:
      _fx_free_rR17K_form__kdefexn_t(&dst->u.KExn); break;
   case 5:
      _fx_free_rR21K_form__kdefvariant_t(&dst->u.KVariant); break;
   case 6:
      _fx_free_rR25K_form__kdefclosurevars_t(&dst->u.KClosureVars); break;
   case 7:
      _fx_free_rR23K_form__kdefinterface_t(&dst->u.KInterface); break;
   case 8:
      _fx_free_rR17K_form__kdeftyp_t(&dst->u.KTyp); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N15K_form__kinfo_t(struct _fx_N15K_form__kinfo_t* src, struct _fx_N15K_form__kinfo_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_R17K_form__kdefval_t(&src->u.KVal, &dst->u.KVal); break;
   case 3:
      FX_COPY_PTR(src->u.KFun, &dst->u.KFun); break;
   case 4:
      FX_COPY_PTR(src->u.KExn, &dst->u.KExn); break;
   case 5:
      FX_COPY_PTR(src->u.KVariant, &dst->u.KVariant); break;
   case 6:
      FX_COPY_PTR(src->u.KClosureVars, &dst->u.KClosureVars); break;
   case 7:
      FX_COPY_PTR(src->u.KInterface, &dst->u.KInterface); break;
   case 8:
      FX_COPY_PTR(src->u.KTyp, &dst->u.KTyp); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_Nt6option1N10Ast__exp_t(struct _fx_Nt6option1N10Ast__exp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_N10Ast__exp_t(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_R13Ast__defval_t(struct _fx_R13Ast__defval_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->dv_typ);
   _fx_free_R16Ast__val_flags_t(&dst->dv_flags);
   fx_free_list_simple(&dst->dv_scope);
}

static void _fx_copy_R13Ast__defval_t(struct _fx_R13Ast__defval_t* src, struct _fx_R13Ast__defval_t* dst)
{
   dst->dv_name = src->dv_name;
   FX_COPY_PTR(src->dv_typ, &dst->dv_typ);
   _fx_copy_R16Ast__val_flags_t(&src->dv_flags, &dst->dv_flags);
   FX_COPY_PTR(src->dv_scope, &dst->dv_scope);
   dst->dv_loc = src->dv_loc;
}

static void _fx_make_R13Ast__defval_t(
   struct _fx_R9Ast__id_t* r_dv_name,
   struct _fx_N10Ast__typ_t_data_t* r_dv_typ,
   struct _fx_R16Ast__val_flags_t* r_dv_flags,
   struct _fx_LN12Ast__scope_t_data_t* r_dv_scope,
   struct _fx_R10Ast__loc_t* r_dv_loc,
   struct _fx_R13Ast__defval_t* fx_result)
{
   fx_result->dv_name = *r_dv_name;
   FX_COPY_PTR(r_dv_typ, &fx_result->dv_typ);
   _fx_copy_R16Ast__val_flags_t(r_dv_flags, &fx_result->dv_flags);
   FX_COPY_PTR(r_dv_scope, &fx_result->dv_scope);
   fx_result->dv_loc = *r_dv_loc;
}

static void _fx_free_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* dst)
{
   _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(&dst->root);
   fx_free_fp(&dst->cmp);
}

static void _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* src,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* dst)
{
   FX_COPY_PTR(src->root, &dst->root);
   FX_COPY_FP(&src->cmp, &dst->cmp);
}

static void _fx_make_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* r_root,
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t* r_cmp,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* fx_result)
{
   FX_COPY_PTR(r_root, &fx_result->root);
   FX_COPY_FP(r_cmp, &fx_result->cmp);
}

static void _fx_free_LN10Ast__pat_t(struct _fx_LN10Ast__pat_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN10Ast__pat_t, _fx_free_N10Ast__pat_t);
}

static int _fx_cons_LN10Ast__pat_t(
   struct _fx_N10Ast__pat_t_data_t* hd,
   struct _fx_LN10Ast__pat_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN10Ast__pat_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN10Ast__pat_t, FX_COPY_PTR);
}

static void _fx_free_rLR9Ast__id_t(struct _fx_rLR9Ast__id_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rLR9Ast__id_t, fx_free_list_simple);
}

static int _fx_make_rLR9Ast__id_t(struct _fx_LR9Ast__id_t_data_t* arg, struct _fx_rLR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rLR9Ast__id_t, FX_COPY_PTR);
}

static void _fx_free_R13Ast__deffun_t(struct _fx_R13Ast__deffun_t* dst)
{
   fx_free_list_simple(&dst->df_templ_args);
   _fx_free_LN10Ast__pat_t(&dst->df_args);
   _fx_free_N10Ast__typ_t(&dst->df_typ);
   _fx_free_N10Ast__exp_t(&dst->df_body);
   fx_free_list_simple(&dst->df_scope);
   _fx_free_rLR9Ast__id_t(&dst->df_templ_inst);
   _fx_free_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&dst->df_env);
}

static void _fx_copy_R13Ast__deffun_t(struct _fx_R13Ast__deffun_t* src, struct _fx_R13Ast__deffun_t* dst)
{
   dst->df_name = src->df_name;
   FX_COPY_PTR(src->df_templ_args, &dst->df_templ_args);
   FX_COPY_PTR(src->df_args, &dst->df_args);
   FX_COPY_PTR(src->df_typ, &dst->df_typ);
   FX_COPY_PTR(src->df_body, &dst->df_body);
   dst->df_flags = src->df_flags;
   FX_COPY_PTR(src->df_scope, &dst->df_scope);
   dst->df_loc = src->df_loc;
   FX_COPY_PTR(src->df_templ_inst, &dst->df_templ_inst);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&src->df_env, &dst->df_env);
}

static void _fx_make_R13Ast__deffun_t(
   struct _fx_R9Ast__id_t* r_df_name,
   struct _fx_LR9Ast__id_t_data_t* r_df_templ_args,
   struct _fx_LN10Ast__pat_t_data_t* r_df_args,
   struct _fx_N10Ast__typ_t_data_t* r_df_typ,
   struct _fx_N10Ast__exp_t_data_t* r_df_body,
   struct _fx_R16Ast__fun_flags_t* r_df_flags,
   struct _fx_LN12Ast__scope_t_data_t* r_df_scope,
   struct _fx_R10Ast__loc_t* r_df_loc,
   struct _fx_rLR9Ast__id_t_data_t* r_df_templ_inst,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* r_df_env,
   struct _fx_R13Ast__deffun_t* fx_result)
{
   fx_result->df_name = *r_df_name;
   FX_COPY_PTR(r_df_templ_args, &fx_result->df_templ_args);
   FX_COPY_PTR(r_df_args, &fx_result->df_args);
   FX_COPY_PTR(r_df_typ, &fx_result->df_typ);
   FX_COPY_PTR(r_df_body, &fx_result->df_body);
   fx_result->df_flags = *r_df_flags;
   FX_COPY_PTR(r_df_scope, &fx_result->df_scope);
   fx_result->df_loc = *r_df_loc;
   FX_COPY_PTR(r_df_templ_inst, &fx_result->df_templ_inst);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(r_df_env, &fx_result->df_env);
}

static void _fx_free_rR13Ast__deffun_t(struct _fx_rR13Ast__deffun_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR13Ast__deffun_t, _fx_free_R13Ast__deffun_t);
}

static int _fx_make_rR13Ast__deffun_t(struct _fx_R13Ast__deffun_t* arg, struct _fx_rR13Ast__deffun_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR13Ast__deffun_t, _fx_copy_R13Ast__deffun_t);
}

static void _fx_free_R13Ast__defexn_t(struct _fx_R13Ast__defexn_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->dexn_typ);
   fx_free_list_simple(&dst->dexn_scope);
}

static void _fx_copy_R13Ast__defexn_t(struct _fx_R13Ast__defexn_t* src, struct _fx_R13Ast__defexn_t* dst)
{
   dst->dexn_name = src->dexn_name;
   FX_COPY_PTR(src->dexn_typ, &dst->dexn_typ);
   FX_COPY_PTR(src->dexn_scope, &dst->dexn_scope);
   dst->dexn_loc = src->dexn_loc;
}

static void _fx_make_R13Ast__defexn_t(
   struct _fx_R9Ast__id_t* r_dexn_name,
   struct _fx_N10Ast__typ_t_data_t* r_dexn_typ,
   struct _fx_LN12Ast__scope_t_data_t* r_dexn_scope,
   struct _fx_R10Ast__loc_t* r_dexn_loc,
   struct _fx_R13Ast__defexn_t* fx_result)
{
   fx_result->dexn_name = *r_dexn_name;
   FX_COPY_PTR(r_dexn_typ, &fx_result->dexn_typ);
   FX_COPY_PTR(r_dexn_scope, &fx_result->dexn_scope);
   fx_result->dexn_loc = *r_dexn_loc;
}

static void _fx_free_rR13Ast__defexn_t(struct _fx_rR13Ast__defexn_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR13Ast__defexn_t, _fx_free_R13Ast__defexn_t);
}

static int _fx_make_rR13Ast__defexn_t(struct _fx_R13Ast__defexn_t* arg, struct _fx_rR13Ast__defexn_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR13Ast__defexn_t, _fx_copy_R13Ast__defexn_t);
}

static void _fx_free_R13Ast__deftyp_t(struct _fx_R13Ast__deftyp_t* dst)
{
   fx_free_list_simple(&dst->dt_templ_args);
   _fx_free_N10Ast__typ_t(&dst->dt_typ);
   fx_free_list_simple(&dst->dt_scope);
}

static void _fx_copy_R13Ast__deftyp_t(struct _fx_R13Ast__deftyp_t* src, struct _fx_R13Ast__deftyp_t* dst)
{
   dst->dt_name = src->dt_name;
   FX_COPY_PTR(src->dt_templ_args, &dst->dt_templ_args);
   FX_COPY_PTR(src->dt_typ, &dst->dt_typ);
   dst->dt_finalized = src->dt_finalized;
   FX_COPY_PTR(src->dt_scope, &dst->dt_scope);
   dst->dt_loc = src->dt_loc;
}

static void _fx_make_R13Ast__deftyp_t(
   struct _fx_R9Ast__id_t* r_dt_name,
   struct _fx_LR9Ast__id_t_data_t* r_dt_templ_args,
   struct _fx_N10Ast__typ_t_data_t* r_dt_typ,
   bool r_dt_finalized,
   struct _fx_LN12Ast__scope_t_data_t* r_dt_scope,
   struct _fx_R10Ast__loc_t* r_dt_loc,
   struct _fx_R13Ast__deftyp_t* fx_result)
{
   fx_result->dt_name = *r_dt_name;
   FX_COPY_PTR(r_dt_templ_args, &fx_result->dt_templ_args);
   FX_COPY_PTR(r_dt_typ, &fx_result->dt_typ);
   fx_result->dt_finalized = r_dt_finalized;
   FX_COPY_PTR(r_dt_scope, &fx_result->dt_scope);
   fx_result->dt_loc = *r_dt_loc;
}

static void _fx_free_rR13Ast__deftyp_t(struct _fx_rR13Ast__deftyp_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR13Ast__deftyp_t, _fx_free_R13Ast__deftyp_t);
}

static int _fx_make_rR13Ast__deftyp_t(struct _fx_R13Ast__deftyp_t* arg, struct _fx_rR13Ast__deftyp_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR13Ast__deftyp_t, _fx_copy_R13Ast__deftyp_t);
}

static void _fx_free_T2R9Ast__id_tN10Ast__typ_t(struct _fx_T2R9Ast__id_tN10Ast__typ_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN10Ast__typ_t(
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* src,
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN10Ast__typ_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN10Ast__typ_t(struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__typ_t, _fx_free_T2R9Ast__id_tN10Ast__typ_t);
}

static int _fx_cons_LT2R9Ast__id_tN10Ast__typ_t(
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* hd,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__typ_t, _fx_copy_T2R9Ast__id_tN10Ast__typ_t);
}

static int _fx_cons_LTa2R9Ast__id_t(
   struct _fx_Ta2R9Ast__id_t* hd,
   struct _fx_LTa2R9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LTa2R9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LTa2R9Ast__id_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_T2R9Ast__id_tLTa2R9Ast__id_t(struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* dst)
{
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* src,
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LTa2R9Ast__id_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tLTa2R9Ast__id_t, _fx_free_T2R9Ast__id_tLTa2R9Ast__id_t);
}

static int _fx_cons_LT2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* hd,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tLTa2R9Ast__id_t, _fx_copy_T2R9Ast__id_tLTa2R9Ast__id_t);
}

static void _fx_free_R17Ast__defvariant_t(struct _fx_R17Ast__defvariant_t* dst)
{
   fx_free_list_simple(&dst->dvar_templ_args);
   _fx_free_N10Ast__typ_t(&dst->dvar_alias);
   _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&dst->dvar_cases);
   fx_free_list_simple(&dst->dvar_ctors);
   _fx_free_rLR9Ast__id_t(&dst->dvar_templ_inst);
   _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(&dst->dvar_ifaces);
   fx_free_list_simple(&dst->dvar_scope);
}

static void _fx_copy_R17Ast__defvariant_t(struct _fx_R17Ast__defvariant_t* src, struct _fx_R17Ast__defvariant_t* dst)
{
   dst->dvar_name = src->dvar_name;
   FX_COPY_PTR(src->dvar_templ_args, &dst->dvar_templ_args);
   FX_COPY_PTR(src->dvar_alias, &dst->dvar_alias);
   dst->dvar_flags = src->dvar_flags;
   FX_COPY_PTR(src->dvar_cases, &dst->dvar_cases);
   FX_COPY_PTR(src->dvar_ctors, &dst->dvar_ctors);
   FX_COPY_PTR(src->dvar_templ_inst, &dst->dvar_templ_inst);
   FX_COPY_PTR(src->dvar_ifaces, &dst->dvar_ifaces);
   FX_COPY_PTR(src->dvar_scope, &dst->dvar_scope);
   dst->dvar_loc = src->dvar_loc;
}

static void _fx_make_R17Ast__defvariant_t(
   struct _fx_R9Ast__id_t* r_dvar_name,
   struct _fx_LR9Ast__id_t_data_t* r_dvar_templ_args,
   struct _fx_N10Ast__typ_t_data_t* r_dvar_alias,
   struct _fx_R16Ast__var_flags_t* r_dvar_flags,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* r_dvar_cases,
   struct _fx_LR9Ast__id_t_data_t* r_dvar_ctors,
   struct _fx_rLR9Ast__id_t_data_t* r_dvar_templ_inst,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* r_dvar_ifaces,
   struct _fx_LN12Ast__scope_t_data_t* r_dvar_scope,
   struct _fx_R10Ast__loc_t* r_dvar_loc,
   struct _fx_R17Ast__defvariant_t* fx_result)
{
   fx_result->dvar_name = *r_dvar_name;
   FX_COPY_PTR(r_dvar_templ_args, &fx_result->dvar_templ_args);
   FX_COPY_PTR(r_dvar_alias, &fx_result->dvar_alias);
   fx_result->dvar_flags = *r_dvar_flags;
   FX_COPY_PTR(r_dvar_cases, &fx_result->dvar_cases);
   FX_COPY_PTR(r_dvar_ctors, &fx_result->dvar_ctors);
   FX_COPY_PTR(r_dvar_templ_inst, &fx_result->dvar_templ_inst);
   FX_COPY_PTR(r_dvar_ifaces, &fx_result->dvar_ifaces);
   FX_COPY_PTR(r_dvar_scope, &fx_result->dvar_scope);
   fx_result->dvar_loc = *r_dvar_loc;
}

static void _fx_free_rR17Ast__defvariant_t(struct _fx_rR17Ast__defvariant_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR17Ast__defvariant_t, _fx_free_R17Ast__defvariant_t);
}

static int _fx_make_rR17Ast__defvariant_t(
   struct _fx_R17Ast__defvariant_t* arg,
   struct _fx_rR17Ast__defvariant_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR17Ast__defvariant_t, _fx_copy_R17Ast__defvariant_t);
}

static void _fx_free_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* src,
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_R16Ast__fun_flags_t* t2,
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t,
      _fx_free_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t);
}

static int _fx_cons_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* hd,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t,
      _fx_copy_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t);
}

static void _fx_free_R19Ast__definterface_t(struct _fx_R19Ast__definterface_t* dst)
{
   _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&dst->di_new_methods);
   _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&dst->di_all_methods);
   fx_free_list_simple(&dst->di_scope);
}

static void _fx_copy_R19Ast__definterface_t(struct _fx_R19Ast__definterface_t* src, struct _fx_R19Ast__definterface_t* dst)
{
   dst->di_name = src->di_name;
   dst->di_base = src->di_base;
   FX_COPY_PTR(src->di_new_methods, &dst->di_new_methods);
   FX_COPY_PTR(src->di_all_methods, &dst->di_all_methods);
   FX_COPY_PTR(src->di_scope, &dst->di_scope);
   dst->di_loc = src->di_loc;
}

static void _fx_make_R19Ast__definterface_t(
   struct _fx_R9Ast__id_t* r_di_name,
   struct _fx_R9Ast__id_t* r_di_base,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* r_di_new_methods,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* r_di_all_methods,
   struct _fx_LN12Ast__scope_t_data_t* r_di_scope,
   struct _fx_R10Ast__loc_t* r_di_loc,
   struct _fx_R19Ast__definterface_t* fx_result)
{
   fx_result->di_name = *r_di_name;
   fx_result->di_base = *r_di_base;
   FX_COPY_PTR(r_di_new_methods, &fx_result->di_new_methods);
   FX_COPY_PTR(r_di_all_methods, &fx_result->di_all_methods);
   FX_COPY_PTR(r_di_scope, &fx_result->di_scope);
   fx_result->di_loc = *r_di_loc;
}

static void _fx_free_rR19Ast__definterface_t(struct _fx_rR19Ast__definterface_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR19Ast__definterface_t, _fx_free_R19Ast__definterface_t);
}

static int _fx_make_rR19Ast__definterface_t(
   struct _fx_R19Ast__definterface_t* arg,
   struct _fx_rR19Ast__definterface_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR19Ast__definterface_t, _fx_copy_R19Ast__definterface_t);
}

static void _fx_free_N14Ast__id_info_t(struct _fx_N14Ast__id_info_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_R13Ast__defval_t(&dst->u.IdDVal); break;
   case 3:
      _fx_free_rR13Ast__deffun_t(&dst->u.IdFun); break;
   case 4:
      _fx_free_rR13Ast__defexn_t(&dst->u.IdExn); break;
   case 5:
      _fx_free_rR13Ast__deftyp_t(&dst->u.IdTyp); break;
   case 6:
      _fx_free_rR17Ast__defvariant_t(&dst->u.IdVariant); break;
   case 7:
      _fx_free_rR19Ast__definterface_t(&dst->u.IdInterface); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N14Ast__id_info_t(struct _fx_N14Ast__id_info_t* src, struct _fx_N14Ast__id_info_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_R13Ast__defval_t(&src->u.IdDVal, &dst->u.IdDVal); break;
   case 3:
      FX_COPY_PTR(src->u.IdFun, &dst->u.IdFun); break;
   case 4:
      FX_COPY_PTR(src->u.IdExn, &dst->u.IdExn); break;
   case 5:
      FX_COPY_PTR(src->u.IdTyp, &dst->u.IdTyp); break;
   case 6:
      FX_COPY_PTR(src->u.IdVariant, &dst->u.IdVariant); break;
   case 7:
      FX_COPY_PTR(src->u.IdInterface, &dst->u.IdInterface); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T3iA1N14Ast__id_info_tN14Ast__id_info_t(struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* dst)
{
   fx_free_arr(&dst->t1);
   _fx_free_N14Ast__id_info_t(&dst->t2);
}

static void _fx_copy_T3iA1N14Ast__id_info_tN14Ast__id_info_t(
   struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* src,
   struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* dst)
{
   dst->t0 = src->t0;
   fx_copy_arr(&src->t1, &dst->t1);
   _fx_copy_N14Ast__id_info_t(&src->t2, &dst->t2);
}

static void _fx_make_T3iA1N14Ast__id_info_tN14Ast__id_info_t(
   int_ t0,
   fx_arr_t* t1,
   struct _fx_N14Ast__id_info_t* t2,
   struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* fx_result)
{
   fx_result->t0 = t0;
   fx_copy_arr(t1, &fx_result->t1);
   _fx_copy_N14Ast__id_info_t(t2, &fx_result->t2);
}

static void _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T3iA1N14Ast__id_info_tN14Ast__id_info_t(&(*dst)->u.t); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_LN16Ast__env_entry_t(struct _fx_LN16Ast__env_entry_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN16Ast__env_entry_t, _fx_free_N16Ast__env_entry_t);
}

static int _fx_cons_LN16Ast__env_entry_t(
   struct _fx_N16Ast__env_entry_t_data_t* hd,
   struct _fx_LN16Ast__env_entry_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN16Ast__env_entry_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN16Ast__env_entry_t, FX_COPY_PTR);
}

static void
   _fx_free_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      dst)
{
   _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(&dst->t1);
   _fx_free_LN16Ast__env_entry_t(&dst->t3);
   _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(&dst->t4);
}

static void
   _fx_copy_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      src,
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   FX_COPY_PTR(src->t3, &dst->t3);
   FX_COPY_PTR(src->t4, &dst->t4);
}

static void
   _fx_make_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_N12Map__color_t* t0,
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t1,
   struct _fx_R9Ast__id_t* t2,
   struct _fx_LN16Ast__env_entry_t_data_t* t3,
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t4,
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   FX_COPY_PTR(t3, &fx_result->t3);
   FX_COPY_PTR(t4, &fx_result->t4);
}

static void _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
         &(*dst)->u.Node);
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
   struct _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* dst)
{
   _fx_free_Nt11Set__tree_t1R9Ast__id_t(&dst->t1);
   _fx_free_Nt11Set__tree_t1R9Ast__id_t(&dst->t3);
}

static void _fx_copy_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
   struct _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* src,
   struct _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   FX_COPY_PTR(src->t3, &dst->t3);
}

static void _fx_make_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
   struct _fx_N12Set__color_t* t0,
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t1,
   struct _fx_R9Ast__id_t* t2,
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t3,
   struct _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   FX_COPY_PTR(t3, &fx_result->t3);
}

static void _fx_free_Nt11Set__tree_t1R9Ast__id_t(struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(&(*dst)->u.Node);
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Rt6Set__t1R9Ast__id_t(struct _fx_Rt6Set__t1R9Ast__id_t* dst)
{
   _fx_free_Nt11Set__tree_t1R9Ast__id_t(&dst->root);
   fx_free_fp(&dst->cmp);
}

static void _fx_copy_Rt6Set__t1R9Ast__id_t(struct _fx_Rt6Set__t1R9Ast__id_t* src, struct _fx_Rt6Set__t1R9Ast__id_t* dst)
{
   FX_COPY_PTR(src->root, &dst->root);
   dst->size = src->size;
   FX_COPY_FP(&src->cmp, &dst->cmp);
}

static void _fx_make_Rt6Set__t1R9Ast__id_t(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* r_root,
   int_ r_size,
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t* r_cmp,
   struct _fx_Rt6Set__t1R9Ast__id_t* fx_result)
{
   FX_COPY_PTR(r_root, &fx_result->root);
   fx_result->size = r_size;
   FX_COPY_FP(r_cmp, &fx_result->cmp);
}

static void _fx_free_T2R10Ast__loc_tS(struct _fx_T2R10Ast__loc_tS* dst)
{
   fx_free_str(&dst->t1);
}

static void _fx_copy_T2R10Ast__loc_tS(struct _fx_T2R10Ast__loc_tS* src, struct _fx_T2R10Ast__loc_tS* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_T2R10Ast__loc_tS(struct _fx_R10Ast__loc_t* t0, fx_str_t* t1, struct _fx_T2R10Ast__loc_tS* fx_result)
{
   fx_result->t0 = *t0;
   fx_copy_str(t1, &fx_result->t1);
}

static void _fx_free_N10Ast__lit_t(struct _fx_N10Ast__lit_t* dst)
{
   switch (dst->tag) {
   case 5:
      fx_free_str(&dst->u.LitString); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N10Ast__lit_t(struct _fx_N10Ast__lit_t* src, struct _fx_N10Ast__lit_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 5:
      fx_copy_str(&src->u.LitString, &dst->u.LitString); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_rNt6option1N10Ast__typ_t(struct _fx_rNt6option1N10Ast__typ_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rNt6option1N10Ast__typ_t, _fx_free_Nt6option1N10Ast__typ_t);
}

static int _fx_make_rNt6option1N10Ast__typ_t(
   struct _fx_Nt6option1N10Ast__typ_t_data_t* arg,
   struct _fx_rNt6option1N10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rNt6option1N10Ast__typ_t, FX_COPY_PTR);
}

static void _fx_free_LN10Ast__typ_t(struct _fx_LN10Ast__typ_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN10Ast__typ_t, _fx_free_N10Ast__typ_t);
}

static int _fx_cons_LN10Ast__typ_t(
   struct _fx_N10Ast__typ_t_data_t* hd,
   struct _fx_LN10Ast__typ_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN10Ast__typ_t, FX_COPY_PTR);
}

static void _fx_free_T2LN10Ast__typ_tN10Ast__typ_t(struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* dst)
{
   _fx_free_LN10Ast__typ_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__typ_tN10Ast__typ_t(
   struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* src,
   struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__typ_tN10Ast__typ_t(
   struct _fx_LN10Ast__typ_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2iN10Ast__typ_t(struct _fx_T2iN10Ast__typ_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2iN10Ast__typ_t(struct _fx_T2iN10Ast__typ_t* src, struct _fx_T2iN10Ast__typ_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2iN10Ast__typ_t(int_ t0, struct _fx_N10Ast__typ_t_data_t* t1, struct _fx_T2iN10Ast__typ_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   _fx_free_R16Ast__val_flags_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t2);
   _fx_free_N10Ast__exp_t(&dst->t3);
}

static void _fx_copy_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* src,
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   _fx_copy_R16Ast__val_flags_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   FX_COPY_PTR(src->t3, &dst->t3);
}

static void _fx_make_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_R16Ast__val_flags_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_N10Ast__typ_t_data_t* t2,
   struct _fx_N10Ast__exp_t_data_t* t3,
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* fx_result)
{
   _fx_copy_R16Ast__val_flags_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   FX_COPY_PTR(t3, &fx_result->t3);
}

static void _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t,
      _fx_free_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t);
}

static int _fx_cons_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* hd,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t,
      _fx_copy_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t);
}

static void _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* dst)
{
   _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&dst->t0);
}

static void _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* src,
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t0,
   bool t1,
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
}

static void _fx_free_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB,
      _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB);
}

static int _fx_make_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* arg,
   struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB,
      _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB);
}

static void _fx_free_T2LN10Ast__typ_tR9Ast__id_t(struct _fx_T2LN10Ast__typ_tR9Ast__id_t* dst)
{
   _fx_free_LN10Ast__typ_t(&dst->t0);
}

static void _fx_copy_T2LN10Ast__typ_tR9Ast__id_t(
   struct _fx_T2LN10Ast__typ_tR9Ast__id_t* src,
   struct _fx_T2LN10Ast__typ_tR9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LN10Ast__typ_tR9Ast__id_t(
   struct _fx_LN10Ast__typ_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_T2LN10Ast__typ_tR9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_N10Ast__typ_t(struct _fx_N10Ast__typ_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 1:
         _fx_free_rNt6option1N10Ast__typ_t(&(*dst)->u.TypVar); break;
      case 2:
         _fx_free_Nt6option1N10Ast__typ_t(&(*dst)->u.TypVarTuple); break;
      case 3:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypVarArray); break;
      case 14:
         _fx_free_T2LN10Ast__typ_tN10Ast__typ_t(&(*dst)->u.TypFun); break;
      case 15:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypList); break;
      case 16:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypVector); break;
      case 17:
         _fx_free_LN10Ast__typ_t(&(*dst)->u.TypTuple); break;
      case 18:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypRef); break;
      case 19:
         _fx_free_T2iN10Ast__typ_t(&(*dst)->u.TypArray); break;
      case 20:
         _fx_free_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&(*dst)->u.TypRecord); break;
      case 24:
         _fx_free_T2LN10Ast__typ_tR9Ast__id_t(&(*dst)->u.TypApp); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_N13Ast__binary_t(struct _fx_N13Ast__binary_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 27:
         _fx_free_N13Ast__binary_t(&(*dst)->u.OpAugBinary); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t0);
}

static void _fx_copy_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__typ_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t0);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t1);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__lit_t(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_copy_N10Ast__lit_t(&src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__lit_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N10Ast__lit_t(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N13Ast__binary_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N13Ast__binary_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N12Ast__unary_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_LN10Ast__exp_t(struct _fx_LN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN10Ast__exp_t, _fx_free_N10Ast__exp_t);
}

static int _fx_cons_LN10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* hd,
   struct _fx_LN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN10Ast__exp_t, FX_COPY_PTR);
}

static void _fx_free_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N13Ast__intrin_t* t0,
   struct _fx_LN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2R9Ast__id_tN10Ast__exp_t(struct _fx_T2R9Ast__id_tN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN10Ast__exp_t(
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* src,
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN10Ast__exp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__exp_t(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_LN10Ast__exp_t_data_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_LLN10Ast__exp_t(struct _fx_LLN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LLN10Ast__exp_t, _fx_free_LN10Ast__exp_t);
}

static int _fx_cons_LLN10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* hd,
   struct _fx_LLN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LLN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LLN10Ast__exp_t, FX_COPY_PTR);
}

static void _fx_free_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LLN10Ast__exp_t(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_LLN10Ast__exp_t_data_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN10Ast__exp_t(struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__exp_t, _fx_free_T2R9Ast__id_tN10Ast__exp_t);
}

static int _fx_cons_LT2R9Ast__id_tN10Ast__exp_t(
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* hd,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__exp_t, _fx_copy_T2R9Ast__id_tN10Ast__exp_t);
}

static void _fx_free_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t3);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t4);
}

static void _fx_copy_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   FX_COPY_PTR(src->t3, &dst->t3);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t4, &dst->t4);
}

static void _fx_make_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N13Ast__border_t* t1,
   struct _fx_N18Ast__interpolate_t* t2,
   struct _fx_LN10Ast__exp_t_data_t* t3,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t4,
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = *t2;
   FX_COPY_PTR(t3, &fx_result->t3);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t4, &fx_result->t4);
}

static void _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2N10Ast__exp_tR10Ast__loc_t(struct _fx_T2N10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T2N10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__exp_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T2N10Ast__pat_tN10Ast__exp_t(struct _fx_T2N10Ast__pat_tN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* src,
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2N10Ast__pat_tN10Ast__exp_t, _fx_free_T2N10Ast__pat_tN10Ast__exp_t);
}

static int _fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* hd,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2N10Ast__pat_tN10Ast__exp_t, _fx_copy_T2N10Ast__pat_tN10Ast__exp_t);
}

static void _fx_free_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* src,
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
   dst->t4 = src->t4;
}

static void _fx_make_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_R16Ast__for_flags_t* t3,
   struct _fx_R10Ast__loc_t* t4,
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = *t3;
   fx_result->t4 = *t4;
}

static void _fx_free_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* dst)
{
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* src,
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t, _fx_free_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t);
}

static int _fx_cons_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* hd,
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t, _fx_copy_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t);
}

static void
   _fx_free_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void
   _fx_copy_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void
   _fx_make_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R16Ast__for_flags_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t*
      fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2ST2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_free_str(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2ST2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2ST2N10Ast__typ_tR10Ast__loc_t(
   fx_str_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T3SST2N10Ast__typ_tR10Ast__loc_t(struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_free_str(&dst->t0);
   fx_free_str(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3SST2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   fx_copy_str(&src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3SST2N10Ast__typ_tR10Ast__loc_t(
   fx_str_t* t0,
   fx_str_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   fx_copy_str(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_R16Ast__val_flags_t(&dst->t2);
}

static void _fx_copy_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* src,
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_R16Ast__val_flags_t(&src->t2, &dst->t2);
   dst->t3 = src->t3;
}

static void _fx_make_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R16Ast__val_flags_t* t2,
   struct _fx_R10Ast__loc_t* t3,
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_R16Ast__val_flags_t(t2, &fx_result->t2);
   fx_result->t3 = *t3;
}

static int _fx_cons_LT2iR9Ast__id_t(
   struct _fx_T2iR9Ast__id_t* hd,
   struct _fx_LT2iR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2iR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2iR9Ast__id_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_T2LT2iR9Ast__id_tR10Ast__loc_t(struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* dst)
{
   fx_free_list_simple(&dst->t0);
}

static void _fx_copy_T2LT2iR9Ast__id_tR10Ast__loc_t(
   struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT2iR9Ast__id_tR10Ast__loc_t(
   struct _fx_LT2iR9Ast__id_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T3iLR9Ast__id_tR10Ast__loc_t(struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* dst)
{
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T3iLR9Ast__id_tR10Ast__loc_t(
   struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3iLR9Ast__id_tR10Ast__loc_t(
   int_ t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2LSR10Ast__loc_t(struct _fx_T2LSR10Ast__loc_t* dst)
{
   _fx_free_LS(&dst->t0);
}

static void _fx_copy_T2LSR10Ast__loc_t(struct _fx_T2LSR10Ast__loc_t* src, struct _fx_T2LSR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LSR10Ast__loc_t(
   struct _fx_LS_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LSR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_N10Ast__exp_t(struct _fx_N10Ast__exp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 4:
         _fx_free_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpReturn); break;
      case 5:
         _fx_free_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
            &(*dst)->u.ExpRange);
         break;
      case 6:
         _fx_free_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpLit); break;
      case 7:
         _fx_free_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpIdent); break;
      case 8:
         _fx_free_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpBinary); break;
      case 9:
         _fx_free_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpUnary); break;
      case 10:
         _fx_free_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpIntrin); break;
      case 11:
         _fx_free_T2R9Ast__id_tN10Ast__exp_t(&(*dst)->u.ExpSync); break;
      case 12:
         _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpSeq); break;
      case 13:
         _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkTuple); break;
      case 14:
         _fx_free_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkArray); break;
      case 15:
         _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkVector); break;
      case 16:
         _fx_free_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkRecord); break;
      case 17:
         _fx_free_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpUpdateRecord); break;
      case 18:
         _fx_free_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpCall); break;
      case 19:
         _fx_free_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
            &(*dst)->u.ExpAt);
         break;
      case 20:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpAssign); break;
      case 21:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMem); break;
      case 22:
         _fx_free_T2N10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpThrow); break;
      case 23:
         _fx_free_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpIf); break;
      case 24:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpWhile); break;
      case 25:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpDoWhile); break;
      case 26:
         _fx_free_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(&(*dst)->u.ExpFor);
         break;
      case 27:
         _fx_free_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
            &(*dst)->u.ExpMap);
         break;
      case 28:
         _fx_free_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpTryCatch); break;
      case 29:
         _fx_free_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMatch); break;
      case 30:
         _fx_free_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpCast); break;
      case 31:
         _fx_free_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpTyped); break;
      case 32:
         _fx_free_T2ST2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpCCode); break;
      case 33:
         _fx_free_T3SST2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpData); break;
      case 34:
         _fx_free_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(&(*dst)->u.DefVal); break;
      case 35:
         _fx_free_rR13Ast__deffun_t(&(*dst)->u.DefFun); break;
      case 36:
         _fx_free_rR13Ast__defexn_t(&(*dst)->u.DefExn); break;
      case 37:
         _fx_free_rR13Ast__deftyp_t(&(*dst)->u.DefTyp); break;
      case 38:
         _fx_free_rR17Ast__defvariant_t(&(*dst)->u.DefVariant); break;
      case 39:
         _fx_free_rR19Ast__definterface_t(&(*dst)->u.DefInterface); break;
      case 40:
         _fx_free_T2LT2iR9Ast__id_tR10Ast__loc_t(&(*dst)->u.DirImport); break;
      case 41:
         _fx_free_T3iLR9Ast__id_tR10Ast__loc_t(&(*dst)->u.DirImportFrom); break;
      case 42:
         _fx_free_T2LSR10Ast__loc_t(&(*dst)->u.DirPragma); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2N10Ast__lit_tR10Ast__loc_t(struct _fx_T2N10Ast__lit_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__lit_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__lit_tR10Ast__loc_t(
   struct _fx_T2N10Ast__lit_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__lit_tR10Ast__loc_t* dst)
{
   _fx_copy_N10Ast__lit_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__lit_tR10Ast__loc_t(
   struct _fx_N10Ast__lit_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__lit_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N10Ast__lit_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2LN10Ast__pat_tR10Ast__loc_t(struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T2LN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LN10Ast__pat_tR10Ast__loc_t(
   struct _fx_LN10Ast__pat_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LN10Ast__pat_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2R9Ast__id_tN10Ast__pat_t(struct _fx_T2R9Ast__id_tN10Ast__pat_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN10Ast__pat_t(
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* src,
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN10Ast__pat_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN10Ast__pat_t(struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__pat_t, _fx_free_T2R9Ast__id_tN10Ast__pat_t);
}

static int _fx_cons_LT2R9Ast__id_tN10Ast__pat_t(
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* hd,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__pat_t, _fx_copy_T2R9Ast__id_tN10Ast__pat_t);
}

static void _fx_free_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_Nt6option1R9Ast__id_t* t0,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2N10Ast__pat_tR10Ast__loc_t(struct _fx_T2N10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__pat_tR10Ast__loc_t(
   struct _fx_T2N10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__pat_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__pat_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__pat_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_N10Ast__pat_t(struct _fx_N10Ast__pat_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 2:
         _fx_free_T2N10Ast__lit_tR10Ast__loc_t(&(*dst)->u.PatLit); break;
      case 4:
         _fx_free_T2LN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatTuple); break;
      case 5:
         _fx_free_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatVariant); break;
      case 6:
         _fx_free_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatRecord); break;
      case 7:
         _fx_free_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatCons); break;
      case 8:
         _fx_free_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(&(*dst)->u.PatAs); break;
      case 9:
         _fx_free_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(&(*dst)->u.PatTyped); break;
      case 10:
         _fx_free_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.PatWhen); break;
      case 11:
         _fx_free_T2LN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatAlt); break;
      case 12:
         _fx_free_T2N10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatRef); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_N16Ast__env_entry_t(struct _fx_N16Ast__env_entry_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) { case 2:     _fx_free_N10Ast__typ_t(&(*dst)->u.EnvTyp); break; default:    ; } fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2SR10Ast__loc_t(struct _fx_T2SR10Ast__loc_t* dst)
{
   fx_free_str(&dst->t0);
}

static void _fx_copy_T2SR10Ast__loc_t(struct _fx_T2SR10Ast__loc_t* src, struct _fx_T2SR10Ast__loc_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2SR10Ast__loc_t(fx_str_t* t0, struct _fx_R10Ast__loc_t* t1, struct _fx_T2SR10Ast__loc_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_LT2SR10Ast__loc_t(struct _fx_LT2SR10Ast__loc_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2SR10Ast__loc_t, _fx_free_T2SR10Ast__loc_t);
}

static int _fx_cons_LT2SR10Ast__loc_t(
   struct _fx_T2SR10Ast__loc_t* hd,
   struct _fx_LT2SR10Ast__loc_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2SR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2SR10Ast__loc_t, _fx_copy_T2SR10Ast__loc_t);
}

static void _fx_free_R14Ast__pragmas_t(struct _fx_R14Ast__pragmas_t* dst)
{
   _fx_free_LT2SR10Ast__loc_t(&dst->pragma_clibs);
}

static void _fx_copy_R14Ast__pragmas_t(struct _fx_R14Ast__pragmas_t* src, struct _fx_R14Ast__pragmas_t* dst)
{
   dst->pragma_cpp = src->pragma_cpp;
   FX_COPY_PTR(src->pragma_clibs, &dst->pragma_clibs);
}

static void _fx_make_R14Ast__pragmas_t(
   bool r_pragma_cpp,
   struct _fx_LT2SR10Ast__loc_t_data_t* r_pragma_clibs,
   struct _fx_R14Ast__pragmas_t* fx_result)
{
   fx_result->pragma_cpp = r_pragma_cpp;
   FX_COPY_PTR(r_pragma_clibs, &fx_result->pragma_clibs);
}

static int _fx_cons_Li(int_ hd, struct _fx_Li_data_t* tl, bool addref_tl, struct _fx_Li_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_Li, FX_COPY_SIMPLE);
}

static void _fx_free_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t* dst)
{
   fx_free_str(&dst->t1);
   _fx_free_LN10Ast__exp_t(&dst->t4);
   fx_free_list_simple(&dst->t5);
   _fx_free_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&dst->t6);
   _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(&dst->t9);
}

static void _fx_copy_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t* src,
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
   dst->t2 = src->t2;
   dst->t3 = src->t3;
   FX_COPY_PTR(src->t4, &dst->t4);
   FX_COPY_PTR(src->t5, &dst->t5);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&src->t6, &dst->t6);
   dst->t7 = src->t7;
   dst->t8 = src->t8;
   FX_COPY_PTR(src->t9, &dst->t9);
}

static void _fx_make_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
   struct _fx_R9Ast__id_t* t0,
   fx_str_t* t1,
   int_ t2,
   bool t3,
   struct _fx_LN10Ast__exp_t_data_t* t4,
   struct _fx_Li_data_t* t5,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* t6,
   bool t7,
   int_ t8,
   struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t* t9,
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t*
      fx_result)
{
   fx_result->t0 = *t0;
   fx_copy_str(t1, &fx_result->t1);
   fx_result->t2 = t2;
   fx_result->t3 = t3;
   FX_COPY_PTR(t4, &fx_result->t4);
   FX_COPY_PTR(t5, &fx_result->t5);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(t6, &fx_result->t6);
   fx_result->t7 = t7;
   fx_result->t8 = t8;
   FX_COPY_PTR(t9, &fx_result->t9);
}

static void _fx_free_N16Ast__defmodule_t(struct _fx_N16Ast__defmodule_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
         &(*dst)->u.defmodule_t);
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_rRt6Set__t1R9Ast__id_t(struct _fx_rRt6Set__t1R9Ast__id_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rRt6Set__t1R9Ast__id_t, _fx_free_Rt6Set__t1R9Ast__id_t);
}

static int _fx_make_rRt6Set__t1R9Ast__id_t(
   struct _fx_Rt6Set__t1R9Ast__id_t* arg,
   struct _fx_rRt6Set__t1R9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rRt6Set__t1R9Ast__id_t, _fx_copy_Rt6Set__t1R9Ast__id_t);
}

static void _fx_free_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* src,
   struct _fx_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_Nt6option1N14K_form__kexp_t(struct _fx_Nt6option1N14K_form__kexp_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_N14K_form__kexp_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1N14K_form__kexp_t(
   struct _fx_Nt6option1N14K_form__kexp_t* src,
   struct _fx_Nt6option1N14K_form__kexp_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      FX_COPY_PTR(src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_Nt6option1rR23K_form__kdefinterface_t(struct _fx_Nt6option1rR23K_form__kdefinterface_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_rR23K_form__kdefinterface_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1rR23K_form__kdefinterface_t(
   struct _fx_Nt6option1rR23K_form__kdefinterface_t* src,
   struct _fx_Nt6option1rR23K_form__kdefinterface_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      FX_COPY_PTR(src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_N14K_form__klit_t(struct _fx_N14K_form__klit_t* dst)
{
   switch (dst->tag) {
   case 5:
      fx_free_str(&dst->u.KLitString); break;
   case 8:
      _fx_free_N14K_form__ktyp_t(&dst->u.KLitNil); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N14K_form__klit_t(struct _fx_N14K_form__klit_t* src, struct _fx_N14K_form__klit_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 5:
      fx_copy_str(&src->u.KLitString, &dst->u.KLitString); break;
   case 8:
      FX_COPY_PTR(src->u.KLitNil, &dst->u.KLitNil); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_N14K_form__atom_t(struct _fx_N14K_form__atom_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_N14K_form__klit_t(&dst->u.AtomLit); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N14K_form__atom_t(struct _fx_N14K_form__atom_t* src, struct _fx_N14K_form__atom_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_N14K_form__klit_t(&src->u.AtomLit, &dst->u.AtomLit); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_Nt6option1N14K_form__atom_t(struct _fx_Nt6option1N14K_form__atom_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_N14K_form__atom_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1N14K_form__atom_t(
   struct _fx_Nt6option1N14K_form__atom_t* src,
   struct _fx_Nt6option1N14K_form__atom_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_N14K_form__atom_t(&src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_LN14K_form__kexp_t(struct _fx_LN14K_form__kexp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN14K_form__kexp_t, _fx_free_N14K_form__kexp_t);
}

static int _fx_cons_LN14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* hd,
   struct _fx_LN14K_form__kexp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN14K_form__kexp_t, FX_COPY_PTR);
}

static void _fx_free_T2BN14K_form__atom_t(struct _fx_T2BN14K_form__atom_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t1);
}

static void _fx_copy_T2BN14K_form__atom_t(struct _fx_T2BN14K_form__atom_t* src, struct _fx_T2BN14K_form__atom_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
}

static void _fx_make_T2BN14K_form__atom_t(bool t0, struct _fx_N14K_form__atom_t* t1, struct _fx_T2BN14K_form__atom_t* fx_result)
{
   fx_result->t0 = t0;
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
}

static void _fx_free_LT2BN14K_form__atom_t(struct _fx_LT2BN14K_form__atom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2BN14K_form__atom_t, _fx_free_T2BN14K_form__atom_t);
}

static int _fx_cons_LT2BN14K_form__atom_t(
   struct _fx_T2BN14K_form__atom_t* hd,
   struct _fx_LT2BN14K_form__atom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2BN14K_form__atom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2BN14K_form__atom_t, _fx_copy_T2BN14K_form__atom_t);
}

static void _fx_free_T2LN14K_form__ktyp_tN14K_form__ktyp_t(struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* dst)
{
   _fx_free_LN14K_form__ktyp_t(&dst->t0);
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__ktyp_tN14K_form__ktyp_t(
   struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* src,
   struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__ktyp_tN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* src,
   struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2iN14K_form__ktyp_t(struct _fx_T2iN14K_form__ktyp_t* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2iN14K_form__ktyp_t(struct _fx_T2iN14K_form__ktyp_t* src, struct _fx_T2iN14K_form__ktyp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2iN14K_form__ktyp_t(
   int_ t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_T2iN14K_form__ktyp_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_N14K_form__ktyp_t(struct _fx_N14K_form__ktyp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 12:
         _fx_free_N14K_form__ktyp_t(&(*dst)->u.KTypRawPointer); break;
      case 13:
         _fx_free_T2LN14K_form__ktyp_tN14K_form__ktyp_t(&(*dst)->u.KTypFun); break;
      case 14:
         _fx_free_LN14K_form__ktyp_t(&(*dst)->u.KTypTuple); break;
      case 15:
         _fx_free_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(&(*dst)->u.KTypRecord); break;
      case 17:
         _fx_free_T2iN14K_form__ktyp_t(&(*dst)->u.KTypArray); break;
      case 18:
         _fx_free_N14K_form__ktyp_t(&(*dst)->u.KTypVector); break;
      case 19:
         _fx_free_N14K_form__ktyp_t(&(*dst)->u.KTypList); break;
      case 20:
         _fx_free_N14K_form__ktyp_t(&(*dst)->u.KTypRef); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Ta3N14K_form__atom_t(struct _fx_Ta3N14K_form__atom_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_N14K_form__atom_t(&dst->t1);
   _fx_free_N14K_form__atom_t(&dst->t2);
}

static void _fx_copy_Ta3N14K_form__atom_t(struct _fx_Ta3N14K_form__atom_t* src, struct _fx_Ta3N14K_form__atom_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
   _fx_copy_N14K_form__atom_t(&src->t2, &dst->t2);
}

static void _fx_make_Ta3N14K_form__atom_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_N14K_form__atom_t* t1,
   struct _fx_N14K_form__atom_t* t2,
   struct _fx_Ta3N14K_form__atom_t* fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
   _fx_copy_N14K_form__atom_t(t2, &fx_result->t2);
}

static void _fx_free_N13K_form__dom_t(struct _fx_N13K_form__dom_t* dst)
{
   switch (dst->tag) {
   case 1:
      _fx_free_N14K_form__atom_t(&dst->u.DomainElem); break;
   case 2:
      _fx_free_N14K_form__atom_t(&dst->u.DomainFast); break;
   case 3:
      _fx_free_Ta3N14K_form__atom_t(&dst->u.DomainRange); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N13K_form__dom_t(struct _fx_N13K_form__dom_t* src, struct _fx_N13K_form__dom_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 1:
      _fx_copy_N14K_form__atom_t(&src->u.DomainElem, &dst->u.DomainElem); break;
   case 2:
      _fx_copy_N14K_form__atom_t(&src->u.DomainFast, &dst->u.DomainFast); break;
   case 3:
      _fx_copy_Ta3N14K_form__atom_t(&src->u.DomainRange, &dst->u.DomainRange); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T2Nt6option1N14K_form__atom_tR10Ast__loc_t(struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* dst)
{
   _fx_free_Nt6option1N14K_form__atom_t(&dst->t0);
}

static void _fx_copy_T2Nt6option1N14K_form__atom_tR10Ast__loc_t(
   struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* src,
   struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* dst)
{
   _fx_copy_Nt6option1N14K_form__atom_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2Nt6option1N14K_form__atom_tR10Ast__loc_t(
   struct _fx_Nt6option1N14K_form__atom_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* fx_result)
{
   _fx_copy_Nt6option1N14K_form__atom_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t0);
}

static void _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N13Ast__binary_t(&dst->t0);
   _fx_free_N14K_form__atom_t(&dst->t1);
   _fx_free_N14K_form__atom_t(&dst->t2);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
   _fx_copy_N14K_form__atom_t(&src->t2, &dst->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N13Ast__binary_t_data_t* t0,
   struct _fx_N14K_form__atom_t* t1,
   struct _fx_N14K_form__atom_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
   _fx_copy_N14K_form__atom_t(t2, &fx_result->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N12Ast__unary_t* t0,
   struct _fx_N14K_form__atom_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_LN14K_form__atom_t(struct _fx_LN14K_form__atom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN14K_form__atom_t, _fx_free_N14K_form__atom_t);
}

static int _fx_cons_LN14K_form__atom_t(
   struct _fx_N14K_form__atom_t* hd,
   struct _fx_LN14K_form__atom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN14K_form__atom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN14K_form__atom_t, _fx_copy_N14K_form__atom_t);
}

static void _fx_free_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N13Ast__intrin_t* t0,
   struct _fx_LN14K_form__atom_t_data_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2R9Ast__id_tN14K_form__kexp_t(struct _fx_T2R9Ast__id_tN14K_form__kexp_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN14K_form__kexp_t(
   struct _fx_T2R9Ast__id_tN14K_form__kexp_t* src,
   struct _fx_T2R9Ast__id_tN14K_form__kexp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN14K_form__kexp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN14K_form__kexp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__kexp_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LN14K_form__kexp_t_data_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
   _fx_free_N14K_form__kexp_t(&dst->t2);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_N14K_form__kexp_t_data_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LN14K_form__atom_t_data_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t2);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   int_ t1,
   struct _fx_LN14K_form__atom_t_data_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LN14K_form__atom_t_data_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t2);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_LN14K_form__atom_t_data_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = *t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_LLT2BN14K_form__atom_t(struct _fx_LLT2BN14K_form__atom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LLT2BN14K_form__atom_t, _fx_free_LT2BN14K_form__atom_t);
}

static int _fx_cons_LLT2BN14K_form__atom_t(
   struct _fx_LT2BN14K_form__atom_t_data_t* hd,
   struct _fx_LLT2BN14K_form__atom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LLT2BN14K_form__atom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LLT2BN14K_form__atom_t, FX_COPY_PTR);
}

static void _fx_free_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LLT2BN14K_form__atom_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   bool t0,
   struct _fx_LLT2BN14K_form__atom_t_data_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LT2BN14K_form__atom_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT2BN14K_form__atom_t_data_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_LN13K_form__dom_t(struct _fx_LN13K_form__dom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN13K_form__dom_t, _fx_free_N13K_form__dom_t);
}

static int _fx_cons_LN13K_form__dom_t(
   struct _fx_N13K_form__dom_t* hd,
   struct _fx_LN13K_form__dom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN13K_form__dom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN13K_form__dom_t, _fx_copy_N13K_form__dom_t);
}

static void _fx_free_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_LN13K_form__dom_t(&dst->t3);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t4);
}

static void _fx_copy_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   FX_COPY_PTR(src->t3, &dst->t3);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t4, &dst->t4);
}

static void _fx_make_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_N13Ast__border_t* t1,
   struct _fx_N18Ast__interpolate_t* t2,
   struct _fx_LN13K_form__dom_t_data_t* t3,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t4,
   struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t*
      fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = *t2;
   FX_COPY_PTR(t3, &fx_result->t3);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t4, &fx_result->t4);
}

static void _fx_free_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   int_ t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = t1;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N14K_form__atom_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t(struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* dst)
{
   _fx_free_LN14K_form__kexp_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__kexp_tN14K_form__kexp_t(
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* src,
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__kexp_tN14K_form__kexp_t(
   struct _fx_LN14K_form__kexp_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2LN14K_form__kexp_tN14K_form__kexp_t, _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t);
}

static int _fx_cons_LT2LN14K_form__kexp_tN14K_form__kexp_t(
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* hd,
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2LN14K_form__kexp_tN14K_form__kexp_t, _fx_copy_T2LN14K_form__kexp_tN14K_form__kexp_t);
}

static void _fx_free_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2R9Ast__id_tN13K_form__dom_t(struct _fx_T2R9Ast__id_tN13K_form__dom_t* dst)
{
   _fx_free_N13K_form__dom_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN13K_form__dom_t(
   struct _fx_T2R9Ast__id_tN13K_form__dom_t* src,
   struct _fx_T2R9Ast__id_tN13K_form__dom_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_N13K_form__dom_t(&src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN13K_form__dom_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N13K_form__dom_t* t1,
   struct _fx_T2R9Ast__id_tN13K_form__dom_t* fx_result)
{
   fx_result->t0 = *t0;
   _fx_copy_N13K_form__dom_t(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN13K_form__dom_t(struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN13K_form__dom_t, _fx_free_T2R9Ast__id_tN13K_form__dom_t);
}

static int _fx_cons_LT2R9Ast__id_tN13K_form__dom_t(
   struct _fx_T2R9Ast__id_tN13K_form__dom_t* hd,
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN13K_form__dom_t, _fx_copy_T2R9Ast__id_tN13K_form__dom_t);
}

static void _fx_free_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t0);
   _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&dst->t1);
   fx_free_list_simple(&dst->t2);
}

static void _fx_copy_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* src,
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_N14K_form__kexp_t_data_t* t0,
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t1,
   struct _fx_LR9Ast__id_t_data_t* t2,
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t,
      _fx_free_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t);
}

static int _fx_cons_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* hd,
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t,
      _fx_copy_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t);
}

static void
   _fx_free_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
      dst)
{
   _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void
   _fx_copy_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
      src,
   struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
      dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void
   _fx_make_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_R16Ast__for_flags_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
      fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&dst->t0);
   fx_free_list_simple(&dst->t1);
   _fx_free_N14K_form__kexp_t(&dst->t2);
}

static void _fx_copy_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* src,
   struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
   dst->t4 = src->t4;
}

static void _fx_make_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_N14K_form__kexp_t_data_t* t2,
   struct _fx_R16Ast__for_flags_t* t3,
   struct _fx_R10Ast__loc_t* t4,
   struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = *t3;
   fx_result->t4 = *t4;
}

static void _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* src,
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2ST2N14K_form__ktyp_tR10Ast__loc_t(struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   fx_free_str(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2ST2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2ST2N14K_form__ktyp_tR10Ast__loc_t(
   fx_str_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_N14K_form__kexp_t(struct _fx_N14K_form__kexp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 4:
         _fx_free_T2Nt6option1N14K_form__atom_tR10Ast__loc_t(&(*dst)->u.KExpReturn); break;
      case 5:
         _fx_free_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpAtom); break;
      case 6:
         _fx_free_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpBinary);
         break;
      case 7:
         _fx_free_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpUnary); break;
      case 8:
         _fx_free_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpIntrin); break;
      case 9:
         _fx_free_T2R9Ast__id_tN14K_form__kexp_t(&(*dst)->u.KExpSync); break;
      case 10:
         _fx_free_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpSeq); break;
      case 11:
         _fx_free_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpIf);
         break;
      case 12:
         _fx_free_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpCall); break;
      case 13:
         _fx_free_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpICall); break;
      case 14:
         _fx_free_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkTuple); break;
      case 15:
         _fx_free_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkRecord); break;
      case 16:
         _fx_free_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkClosure); break;
      case 17:
         _fx_free_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkArray); break;
      case 18:
         _fx_free_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkVector); break;
      case 19:
         _fx_free_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &(*dst)->u.KExpAt);
         break;
      case 20:
         _fx_free_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMem); break;
      case 21:
         _fx_free_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(&(*dst)->u.KExpAssign); break;
      case 22:
         _fx_free_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMatch); break;
      case 23:
         _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpTryCatch); break;
      case 25:
         _fx_free_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpCast); break;
      case 26:
         _fx_free_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &(*dst)->u.KExpMap);
         break;
      case 27:
         _fx_free_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
            &(*dst)->u.KExpFor);
         break;
      case 28:
         _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(&(*dst)->u.KExpWhile); break;
      case 29:
         _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(&(*dst)->u.KExpDoWhile); break;
      case 30:
         _fx_free_T2ST2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpCCode); break;
      case 31:
         _fx_free_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(&(*dst)->u.KDefVal); break;
      case 32:
         _fx_free_rR17K_form__kdeffun_t(&(*dst)->u.KDefFun); break;
      case 33:
         _fx_free_rR17K_form__kdefexn_t(&(*dst)->u.KDefExn); break;
      case 34:
         _fx_free_rR21K_form__kdefvariant_t(&(*dst)->u.KDefVariant); break;
      case 35:
         _fx_free_rR23K_form__kdefinterface_t(&(*dst)->u.KDefInterface); break;
      case 36:
         _fx_free_rR17K_form__kdeftyp_t(&(*dst)->u.KDefTyp); break;
      case 37:
         _fx_free_rR25K_form__kdefclosurevars_t(&(*dst)->u.KDefClosureVars); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2N14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* src,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* dst)
{
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLN14K_form__kexp_t(
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* src,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_R17K_form__kmodule_t(struct _fx_R17K_form__kmodule_t* dst)
{
   fx_free_str(&dst->km_cname);
   _fx_free_LN14K_form__kexp_t(&dst->km_top);
   fx_free_list_simple(&dst->km_deps);
   _fx_free_R14Ast__pragmas_t(&dst->km_pragmas);
}

static void _fx_copy_R17K_form__kmodule_t(struct _fx_R17K_form__kmodule_t* src, struct _fx_R17K_form__kmodule_t* dst)
{
   dst->km_name = src->km_name;
   dst->km_idx = src->km_idx;
   dst->km_toposort_idx = src->km_toposort_idx;
   fx_copy_str(&src->km_cname, &dst->km_cname);
   FX_COPY_PTR(src->km_top, &dst->km_top);
   FX_COPY_PTR(src->km_deps, &dst->km_deps);
   dst->km_skip = src->km_skip;
   dst->km_main = src->km_main;
   _fx_copy_R14Ast__pragmas_t(&src->km_pragmas, &dst->km_pragmas);
}

static void _fx_make_R17K_form__kmodule_t(
   struct _fx_R9Ast__id_t* r_km_name,
   int_ r_km_idx,
   int_ r_km_toposort_idx,
   fx_str_t* r_km_cname,
   struct _fx_LN14K_form__kexp_t_data_t* r_km_top,
   struct _fx_Li_data_t* r_km_deps,
   bool r_km_skip,
   bool r_km_main,
   struct _fx_R14Ast__pragmas_t* r_km_pragmas,
   struct _fx_R17K_form__kmodule_t* fx_result)
{
   fx_result->km_name = *r_km_name;
   fx_result->km_idx = r_km_idx;
   fx_result->km_toposort_idx = r_km_toposort_idx;
   fx_copy_str(r_km_cname, &fx_result->km_cname);
   FX_COPY_PTR(r_km_top, &fx_result->km_top);
   FX_COPY_PTR(r_km_deps, &fx_result->km_deps);
   fx_result->km_skip = r_km_skip;
   fx_result->km_main = r_km_main;
   _fx_copy_R14Ast__pragmas_t(r_km_pragmas, &fx_result->km_pragmas);
}

static void _fx_free_LR17K_form__kmodule_t(struct _fx_LR17K_form__kmodule_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LR17K_form__kmodule_t, _fx_free_R17K_form__kmodule_t);
}

static int _fx_cons_LR17K_form__kmodule_t(
   struct _fx_R17K_form__kmodule_t* hd,
   struct _fx_LR17K_form__kmodule_t_data_t* tl,
   bool addref_tl,
   struct _fx_LR17K_form__kmodule_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LR17K_form__kmodule_t, _fx_copy_R17K_form__kmodule_t);
}

static void _fx_free_R23K_normalize__pat_info_t(struct _fx_R23K_normalize__pat_info_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->pinfo_p);
   _fx_free_N14K_form__ktyp_t(&dst->pinfo_typ);
   _fx_free_N14K_form__kexp_t(&dst->pinfo_e);
}

static void _fx_copy_R23K_normalize__pat_info_t(
   struct _fx_R23K_normalize__pat_info_t* src,
   struct _fx_R23K_normalize__pat_info_t* dst)
{
   FX_COPY_PTR(src->pinfo_p, &dst->pinfo_p);
   FX_COPY_PTR(src->pinfo_typ, &dst->pinfo_typ);
   FX_COPY_PTR(src->pinfo_e, &dst->pinfo_e);
   dst->pinfo_tag = src->pinfo_tag;
}

static void _fx_make_R23K_normalize__pat_info_t(
   struct _fx_N10Ast__pat_t_data_t* r_pinfo_p,
   struct _fx_N14K_form__ktyp_t_data_t* r_pinfo_typ,
   struct _fx_N14K_form__kexp_t_data_t* r_pinfo_e,
   struct _fx_R9Ast__id_t* r_pinfo_tag,
   struct _fx_R23K_normalize__pat_info_t* fx_result)
{
   FX_COPY_PTR(r_pinfo_p, &fx_result->pinfo_p);
   FX_COPY_PTR(r_pinfo_typ, &fx_result->pinfo_typ);
   FX_COPY_PTR(r_pinfo_e, &fx_result->pinfo_e);
   fx_result->pinfo_tag = *r_pinfo_tag;
}

static void _fx_free_Nt6option1R23K_normalize__pat_info_t(struct _fx_Nt6option1R23K_normalize__pat_info_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_R23K_normalize__pat_info_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1R23K_normalize__pat_info_t(
   struct _fx_Nt6option1R23K_normalize__pat_info_t* src,
   struct _fx_Nt6option1R23K_normalize__pat_info_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_R23K_normalize__pat_info_t(&src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(struct _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* dst)
{
   _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&dst->t0);
}

static void _fx_copy_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(
   struct _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* src,
   struct _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* dst)
{
   _fx_copy_T2R9Ast__id_tN14K_form__ktyp_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
}

static void _fx_make_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* t0,
   int_ t1,
   struct _fx_R9Ast__id_t* t2,
   struct _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* fx_result)
{
   _fx_copy_T2R9Ast__id_tN14K_form__ktyp_t(t0, &fx_result->t0);
   fx_result->t1 = t1;
   fx_result->t2 = *t2;
}

static void _fx_free_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(
   struct _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(
   struct _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* src,
   struct _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_Nt6option1T2R9Ast__id_tN10Ast__exp_t(struct _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_T2R9Ast__id_tN10Ast__exp_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1T2R9Ast__id_tN10Ast__exp_t(
   struct _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t* src,
   struct _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_T2R9Ast__id_tN10Ast__exp_t(&src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_LR23K_normalize__pat_info_t(struct _fx_LR23K_normalize__pat_info_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LR23K_normalize__pat_info_t, _fx_free_R23K_normalize__pat_info_t);
}

static int _fx_cons_LR23K_normalize__pat_info_t(
   struct _fx_R23K_normalize__pat_info_t* hd,
   struct _fx_LR23K_normalize__pat_info_t_data_t* tl,
   bool addref_tl,
   struct _fx_LR23K_normalize__pat_info_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LR23K_normalize__pat_info_t, _fx_copy_R23K_normalize__pat_info_t);
}

static void _fx_free_T2N14K_form__atom_ti(struct _fx_T2N14K_form__atom_ti* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
}

static void _fx_copy_T2N14K_form__atom_ti(struct _fx_T2N14K_form__atom_ti* src, struct _fx_T2N14K_form__atom_ti* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N14K_form__atom_ti(struct _fx_N14K_form__atom_t* t0, int_ t1, struct _fx_T2N14K_form__atom_ti* fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   fx_result->t1 = t1;
}

static void _fx_free_LT2N14K_form__atom_ti(struct _fx_LT2N14K_form__atom_ti_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2N14K_form__atom_ti, _fx_free_T2N14K_form__atom_ti);
}

static int _fx_cons_LT2N14K_form__atom_ti(
   struct _fx_T2N14K_form__atom_ti* hd,
   struct _fx_LT2N14K_form__atom_ti_data_t* tl,
   bool addref_tl,
   struct _fx_LT2N14K_form__atom_ti_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2N14K_form__atom_ti, _fx_copy_T2N14K_form__atom_ti);
}

static void _fx_free_T2Nt11Set__tree_t1R9Ast__id_ti(struct _fx_T2Nt11Set__tree_t1R9Ast__id_ti* dst)
{
   _fx_free_Nt11Set__tree_t1R9Ast__id_t(&dst->t0);
}

static void _fx_copy_T2Nt11Set__tree_t1R9Ast__id_ti(
   struct _fx_T2Nt11Set__tree_t1R9Ast__id_ti* src,
   struct _fx_T2Nt11Set__tree_t1R9Ast__id_ti* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2Nt11Set__tree_t1R9Ast__id_ti(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t0,
   int_ t1,
   struct _fx_T2Nt11Set__tree_t1R9Ast__id_ti* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
}

static void _fx_free_T2Nt11Set__tree_t1R9Ast__id_tB(struct _fx_T2Nt11Set__tree_t1R9Ast__id_tB* dst)
{
   _fx_free_Nt11Set__tree_t1R9Ast__id_t(&dst->t0);
}

static void _fx_copy_T2Nt11Set__tree_t1R9Ast__id_tB(
   struct _fx_T2Nt11Set__tree_t1R9Ast__id_tB* src,
   struct _fx_T2Nt11Set__tree_t1R9Ast__id_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2Nt11Set__tree_t1R9Ast__id_tB(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t0,
   bool t1,
   struct _fx_T2Nt11Set__tree_t1R9Ast__id_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
}

static void _fx_free_T3Nt11Set__tree_t1R9Ast__id_tBi(struct _fx_T3Nt11Set__tree_t1R9Ast__id_tBi* dst)
{
   _fx_free_Nt11Set__tree_t1R9Ast__id_t(&dst->t0);
}

static void _fx_copy_T3Nt11Set__tree_t1R9Ast__id_tBi(
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tBi* src,
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tBi* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
}

static void _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t0,
   bool t1,
   int_ t2,
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tBi* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
   fx_result->t2 = t2;
}

static void _fx_free_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(struct _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB* dst)
{
   _fx_free_Nt11Set__tree_t1R9Ast__id_t(&dst->t0);
}

static void _fx_copy_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB* src,
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
}

static void _fx_make_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   bool t2,
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = t2;
}

static void _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(struct _fx_T2N14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2N14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T2N14K_form__kexp_tLN14K_form__kexp_t* src,
   struct _fx_T2N14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2N14K_form__kexp_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t* dst)
{
   _fx_free_Nt6option1N14K_form__atom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t* src,
   struct _fx_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t* dst)
{
   _fx_copy_Nt6option1N14K_form__atom_t(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_Nt6option1N14K_form__atom_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t* fx_result)
{
   _fx_copy_Nt6option1N14K_form__atom_t(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(struct _fx_T2LN14K_form__atom_tLN14K_form__kexp_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_T2LN14K_form__atom_tLN14K_form__kexp_t* src,
   struct _fx_T2LN14K_form__atom_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_LN14K_form__atom_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2LN14K_form__atom_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN14K_form__kexp_tLT2SR10Ast__loc_t(struct _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__kexp_t(&dst->t0);
   _fx_free_LT2SR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__kexp_tLT2SR10Ast__loc_t(
   struct _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t* src,
   struct _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__kexp_tLT2SR10Ast__loc_t(
   struct _fx_LN14K_form__kexp_t_data_t* t0,
   struct _fx_LT2SR10Ast__loc_t_data_t* t1,
   struct _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(struct _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB* dst)
{
   _fx_free_LLT2BN14K_form__atom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(
   struct _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB* src,
   struct _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(
   struct _fx_LLT2BN14K_form__atom_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   bool t2,
   struct _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = t2;
}

static void _fx_free_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(struct _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB* dst)
{
   _fx_free_LT2BN14K_form__atom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(
   struct _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB* src,
   struct _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(
   struct _fx_LT2BN14K_form__atom_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   bool t2,
   struct _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = t2;
}

static void _fx_free_T3BN10Ast__exp_tB(struct _fx_T3BN10Ast__exp_tB* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T3BN10Ast__exp_tB(struct _fx_T3BN10Ast__exp_tB* src, struct _fx_T3BN10Ast__exp_tB* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3BN10Ast__exp_tB(
   bool t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   bool t2,
   struct _fx_T3BN10Ast__exp_tB* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = t2;
}

static void _fx_free_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(struct _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t* dst)
{
   _fx_free_LT2BN14K_form__atom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t* src,
   struct _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_LT2BN14K_form__atom_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2BN10Ast__exp_t(struct _fx_T2BN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2BN10Ast__exp_t(struct _fx_T2BN10Ast__exp_t* src, struct _fx_T2BN10Ast__exp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2BN10Ast__exp_t(bool t0, struct _fx_N10Ast__exp_t_data_t* t1, struct _fx_T2BN10Ast__exp_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* src,
   struct _fx_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t2,
   struct _fx_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = *t1;
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T2LN10Ast__exp_tNt6option1N10Ast__exp_t(struct _fx_T2LN10Ast__exp_tNt6option1N10Ast__exp_t* dst)
{
   _fx_free_LN10Ast__exp_t(&dst->t0);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__exp_tNt6option1N10Ast__exp_t(
   struct _fx_T2LN10Ast__exp_tNt6option1N10Ast__exp_t* src,
   struct _fx_T2LN10Ast__exp_tNt6option1N10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__exp_tNt6option1N10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* t0,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1,
   struct _fx_T2LN10Ast__exp_tNt6option1N10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&dst->t0);
   fx_free_list_simple(&dst->t1);
   _fx_free_LN14K_form__kexp_t(&dst->t2);
   _fx_free_LN14K_form__kexp_t(&dst->t3);
}

static void _fx_copy_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t* src,
   struct _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   FX_COPY_PTR(src->t3, &dst->t3);
}

static void _fx_make_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_LN14K_form__kexp_t_data_t* t2,
   struct _fx_LN14K_form__kexp_t_data_t* t3,
   struct _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   FX_COPY_PTR(t3, &fx_result->t3);
}

static void _fx_free_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(
   struct _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t* dst)
{
   _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(
   struct _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t* src,
   struct _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(struct _fx_T2LN13K_form__dom_tLN14K_form__kexp_t* dst)
{
   _fx_free_LN13K_form__dom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2LN13K_form__dom_tLN14K_form__kexp_t(
   struct _fx_T2LN13K_form__dom_tLN14K_form__kexp_t* src,
   struct _fx_T2LN13K_form__dom_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN13K_form__dom_tLN14K_form__kexp_t(
   struct _fx_LN13K_form__dom_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2LN13K_form__dom_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2N13K_form__dom_tLN14K_form__kexp_t(struct _fx_T2N13K_form__dom_tLN14K_form__kexp_t* dst)
{
   _fx_free_N13K_form__dom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2N13K_form__dom_tLN14K_form__kexp_t(
   struct _fx_T2N13K_form__dom_tLN14K_form__kexp_t* src,
   struct _fx_T2N13K_form__dom_tLN14K_form__kexp_t* dst)
{
   _fx_copy_N13K_form__dom_t(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N13K_form__dom_tLN14K_form__kexp_t(
   struct _fx_N13K_form__dom_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2N13K_form__dom_tLN14K_form__kexp_t* fx_result)
{
   _fx_copy_N13K_form__dom_t(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4R9Ast__id_tiN14K_form__ktyp_tB(struct _fx_T4R9Ast__id_tiN14K_form__ktyp_tB* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t2);
}

static void _fx_copy_T4R9Ast__id_tiN14K_form__ktyp_tB(
   struct _fx_T4R9Ast__id_tiN14K_form__ktyp_tB* src,
   struct _fx_T4R9Ast__id_tiN14K_form__ktyp_tB* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
}

static void _fx_make_T4R9Ast__id_tiN14K_form__ktyp_tB(
   struct _fx_R9Ast__id_t* t0,
   int_ t1,
   struct _fx_N14K_form__ktyp_t_data_t* t2,
   bool t3,
   struct _fx_T4R9Ast__id_tiN14K_form__ktyp_tB* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = t3;
}

static void _fx_free_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   _fx_free_T4R9Ast__id_tiN14K_form__ktyp_tB(&dst->t0);
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t* src,
   struct _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   _fx_copy_T4R9Ast__id_tiN14K_form__ktyp_tB(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_T4R9Ast__id_tiN14K_form__ktyp_tB* t0,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* t1,
   struct _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t* fx_result)
{
   _fx_copy_T4R9Ast__id_tiN14K_form__ktyp_tB(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t* src,
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
   _fx_free_LN14K_form__kexp_t(&dst->t2);
}

static void _fx_copy_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t* src,
   struct _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_LN14K_form__kexp_t_data_t* t2,
   struct _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(struct _fx_T2LR9Ast__id_tLN14K_form__kexp_t* dst)
{
   fx_free_list_simple(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2LR9Ast__id_tLN14K_form__kexp_t(
   struct _fx_T2LR9Ast__id_tLN14K_form__kexp_t* src,
   struct _fx_T2LR9Ast__id_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LR9Ast__id_tLN14K_form__kexp_t(
   struct _fx_LR9Ast__id_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2LR9Ast__id_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LR9Ast__id_tLN14K_form__ktyp_t(struct _fx_T2LR9Ast__id_tLN14K_form__ktyp_t* dst)
{
   fx_free_list_simple(&dst->t0);
   _fx_free_LN14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2LR9Ast__id_tLN14K_form__ktyp_t(
   struct _fx_T2LR9Ast__id_tLN14K_form__ktyp_t* src,
   struct _fx_T2LR9Ast__id_tLN14K_form__ktyp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LR9Ast__id_tLN14K_form__ktyp_t(
   struct _fx_LR9Ast__id_t_data_t* t0,
   struct _fx_LN14K_form__ktyp_t_data_t* t1,
   struct _fx_T2LR9Ast__id_tLN14K_form__ktyp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_rLT2SR10Ast__loc_t(struct _fx_rLT2SR10Ast__loc_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rLT2SR10Ast__loc_t, _fx_free_LT2SR10Ast__loc_t);
}

static int _fx_make_rLT2SR10Ast__loc_t(
   struct _fx_LT2SR10Ast__loc_t_data_t* arg,
   struct _fx_rLT2SR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rLT2SR10Ast__loc_t, FX_COPY_PTR);
}

static void _fx_free_T5R9Ast__id_tiN14K_form__ktyp_tBB(struct _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t2);
}

static void _fx_copy_T5R9Ast__id_tiN14K_form__ktyp_tBB(
   struct _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB* src,
   struct _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
   dst->t4 = src->t4;
}

static void _fx_make_T5R9Ast__id_tiN14K_form__ktyp_tBB(
   struct _fx_R9Ast__id_t* t0,
   int_ t1,
   struct _fx_N14K_form__ktyp_t_data_t* t2,
   bool t3,
   bool t4,
   struct _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = t3;
   fx_result->t4 = t4;
}

static void _fx_free_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(struct _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t1);
   _fx_free_N14K_form__ktyp_t(&dst->t2);
}

static void _fx_copy_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* src,
   struct _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
}

static void _fx_make_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_N14K_form__ktyp_t_data_t* t2,
   int_ t3,
   struct _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = t3;
}

static void _fx_free_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti, _fx_free_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti);
}

static int _fx_cons_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* hd,
   struct _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti_data_t* tl,
   bool addref_tl,
   struct _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti, _fx_copy_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti);
}

static void _fx_free_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* dst)
{
   _fx_free_T5R9Ast__id_tiN14K_form__ktyp_tBB(&dst->t0);
   _fx_free_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&dst->t1);
}

static void _fx_copy_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* src,
   struct _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* dst)
{
   _fx_copy_T5R9Ast__id_tiN14K_form__ktyp_tBB(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB* t0,
   struct _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti_data_t* t1,
   struct _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* fx_result)
{
   _fx_copy_T5R9Ast__id_tiN14K_form__ktyp_tBB(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T3R9Ast__id_tiN14K_form__ktyp_t(struct _fx_T3R9Ast__id_tiN14K_form__ktyp_t* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t2);
}

static void _fx_copy_T3R9Ast__id_tiN14K_form__ktyp_t(
   struct _fx_T3R9Ast__id_tiN14K_form__ktyp_t* src,
   struct _fx_T3R9Ast__id_tiN14K_form__ktyp_t* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3R9Ast__id_tiN14K_form__ktyp_t(
   struct _fx_R9Ast__id_t* t0,
   int_ t1,
   struct _fx_N14K_form__ktyp_t_data_t* t2,
   struct _fx_T3R9Ast__id_tiN14K_form__ktyp_t* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = t1;
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T2N10Ast__pat_tN14K_form__ktyp_t(struct _fx_T2N10Ast__pat_tN14K_form__ktyp_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2N10Ast__pat_tN14K_form__ktyp_t(
   struct _fx_T2N10Ast__pat_tN14K_form__ktyp_t* src,
   struct _fx_T2N10Ast__pat_tN14K_form__ktyp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N10Ast__pat_tN14K_form__ktyp_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_T2N10Ast__pat_tN14K_form__ktyp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2N10Ast__pat_tN14K_form__ktyp_t(struct _fx_LT2N10Ast__pat_tN14K_form__ktyp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2N10Ast__pat_tN14K_form__ktyp_t, _fx_free_T2N10Ast__pat_tN14K_form__ktyp_t);
}

static int _fx_cons_LT2N10Ast__pat_tN14K_form__ktyp_t(
   struct _fx_T2N10Ast__pat_tN14K_form__ktyp_t* hd,
   struct _fx_LT2N10Ast__pat_tN14K_form__ktyp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2N10Ast__pat_tN14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2N10Ast__pat_tN14K_form__ktyp_t, _fx_copy_T2N10Ast__pat_tN14K_form__ktyp_t);
}

static void _fx_free_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t(
   struct _fx_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t* dst)
{
   _fx_free_T3R9Ast__id_tiN14K_form__ktyp_t(&dst->t0);
   _fx_free_LT2N10Ast__pat_tN14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t(
   struct _fx_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t* src,
   struct _fx_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t* dst)
{
   _fx_copy_T3R9Ast__id_tiN14K_form__ktyp_t(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t(
   struct _fx_T3R9Ast__id_tiN14K_form__ktyp_t* t0,
   struct _fx_LT2N10Ast__pat_tN14K_form__ktyp_t_data_t* t1,
   struct _fx_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t* fx_result)
{
   _fx_copy_T3R9Ast__id_tiN14K_form__ktyp_t(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4N10Ast__pat_tR9Ast__id_tBB(struct _fx_T4N10Ast__pat_tR9Ast__id_tBB* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T4N10Ast__pat_tR9Ast__id_tBB(
   struct _fx_T4N10Ast__pat_tR9Ast__id_tBB* src,
   struct _fx_T4N10Ast__pat_tR9Ast__id_tBB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   dst->t3 = src->t3;
}

static void _fx_make_T4N10Ast__pat_tR9Ast__id_tBB(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   bool t2,
   bool t3,
   struct _fx_T4N10Ast__pat_tR9Ast__id_tBB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = t2;
   fx_result->t3 = t3;
}

static void _fx_free_T2LN14K_form__atom_tB(struct _fx_T2LN14K_form__atom_tB* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t0);
}

static void _fx_copy_T2LN14K_form__atom_tB(struct _fx_T2LN14K_form__atom_tB* src, struct _fx_T2LN14K_form__atom_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LN14K_form__atom_tB(
   struct _fx_LN14K_form__atom_t_data_t* t0,
   bool t1,
   struct _fx_T2LN14K_form__atom_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
}

static void _fx_free_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t1);
   _fx_free_LN14K_form__kexp_t(&dst->t2);
}

static void _fx_copy_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t* src,
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_LN14K_form__kexp_t_data_t* t2,
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_Ta3LR23K_normalize__pat_info_t(struct _fx_Ta3LR23K_normalize__pat_info_t* dst)
{
   _fx_free_LR23K_normalize__pat_info_t(&dst->t0);
   _fx_free_LR23K_normalize__pat_info_t(&dst->t1);
   _fx_free_LR23K_normalize__pat_info_t(&dst->t2);
}

static void _fx_copy_Ta3LR23K_normalize__pat_info_t(
   struct _fx_Ta3LR23K_normalize__pat_info_t* src,
   struct _fx_Ta3LR23K_normalize__pat_info_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_Ta3LR23K_normalize__pat_info_t(
   struct _fx_LR23K_normalize__pat_info_t_data_t* t0,
   struct _fx_LR23K_normalize__pat_info_t_data_t* t1,
   struct _fx_LR23K_normalize__pat_info_t_data_t* t2,
   struct _fx_Ta3LR23K_normalize__pat_info_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T3N10Ast__pat_tN14K_form__ktyp_ti(struct _fx_T3N10Ast__pat_tN14K_form__ktyp_ti* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_T3N10Ast__pat_tN14K_form__ktyp_ti* src,
   struct _fx_T3N10Ast__pat_tN14K_form__ktyp_ti* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   int_ t2,
   struct _fx_T3N10Ast__pat_tN14K_form__ktyp_ti* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = t2;
}

static void _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(struct _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT3N10Ast__pat_tN14K_form__ktyp_ti, _fx_free_T3N10Ast__pat_tN14K_form__ktyp_ti);
}

static int _fx_cons_LT3N10Ast__pat_tN14K_form__ktyp_ti(
   struct _fx_T3N10Ast__pat_tN14K_form__ktyp_ti* hd,
   struct _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti_data_t* tl,
   bool addref_tl,
   struct _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT3N10Ast__pat_tN14K_form__ktyp_ti, _fx_copy_T3N10Ast__pat_tN14K_form__ktyp_ti);
}

static void _fx_free_Ta2LN14K_form__kexp_t(struct _fx_Ta2LN14K_form__kexp_t* dst)
{
   _fx_free_LN14K_form__kexp_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_Ta2LN14K_form__kexp_t(struct _fx_Ta2LN14K_form__kexp_t* src, struct _fx_Ta2LN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_Ta2LN14K_form__kexp_t(
   struct _fx_LN14K_form__kexp_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_Ta2LN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t(
   struct _fx_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t* dst)
{
   _fx_free_Nt6option1R23K_normalize__pat_info_t(&dst->t0);
   _fx_free_Ta3LR23K_normalize__pat_info_t(&dst->t1);
}

static void _fx_copy_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t(
   struct _fx_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t* src,
   struct _fx_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t* dst)
{
   _fx_copy_Nt6option1R23K_normalize__pat_info_t(&src->t0, &dst->t0);
   _fx_copy_Ta3LR23K_normalize__pat_info_t(&src->t1, &dst->t1);
}

static void _fx_make_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t(
   struct _fx_Nt6option1R23K_normalize__pat_info_t* t0,
   struct _fx_Ta3LR23K_normalize__pat_info_t* t1,
   struct _fx_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t* fx_result)
{
   _fx_copy_Nt6option1R23K_normalize__pat_info_t(t0, &fx_result->t0);
   _fx_copy_Ta3LR23K_normalize__pat_info_t(t1, &fx_result->t1);
}

static void _fx_free_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   _fx_free_Ta3LR23K_normalize__pat_info_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
   _fx_free_LN14K_form__kexp_t(&dst->t2);
}

static void _fx_copy_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t* src,
   struct _fx_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t* dst)
{
   _fx_copy_Ta3LR23K_normalize__pat_info_t(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_Ta3LR23K_normalize__pat_info_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_LN14K_form__kexp_t_data_t* t2,
   struct _fx_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t* fx_result)
{
   _fx_copy_Ta3LR23K_normalize__pat_info_t(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(
   struct _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* dst)
{
   _fx_free_LN14K_form__ktyp_t(&dst->t1);
   _fx_free_LN14K_form__kexp_t(&dst->t2);
   _fx_free_LN14K_form__kexp_t(&dst->t3);
   _fx_free_Nt6option1N14K_form__kexp_t(&dst->t4);
}

static void _fx_copy_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(
   struct _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* src,
   struct _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   FX_COPY_PTR(src->t3, &dst->t3);
   _fx_copy_Nt6option1N14K_form__kexp_t(&src->t4, &dst->t4);
}

static void _fx_make_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LN14K_form__ktyp_t_data_t* t1,
   struct _fx_LN14K_form__kexp_t_data_t* t2,
   struct _fx_LN14K_form__kexp_t_data_t* t3,
   struct _fx_Nt6option1N14K_form__kexp_t* t4,
   struct _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   FX_COPY_PTR(t3, &fx_result->t3);
   _fx_copy_Nt6option1N14K_form__kexp_t(t4, &fx_result->t4);
}

static void _fx_free_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t(
   struct _fx_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t* dst)
{
   _fx_free_LN14K_form__ktyp_t(&dst->t0);
   _fx_free_N14K_form__atom_t(&dst->t1);
   _fx_free_N14K_form__atom_t(&dst->t2);
}

static void _fx_copy_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t(
   struct _fx_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t* src,
   struct _fx_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
   _fx_copy_N14K_form__atom_t(&src->t2, &dst->t2);
}

static void _fx_make_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t(
   struct _fx_LN14K_form__ktyp_t_data_t* t0,
   struct _fx_N14K_form__atom_t* t1,
   struct _fx_N14K_form__atom_t* t2,
   struct _fx_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
   _fx_copy_N14K_form__atom_t(t2, &fx_result->t2);
}

static void _fx_free_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(
   struct _fx_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* dst)
{
   _fx_free_LN14K_form__kexp_t(&dst->t1);
   _fx_free_Nt6option1N14K_form__kexp_t(&dst->t2);
}

static void _fx_copy_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(
   struct _fx_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* src,
   struct _fx_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_Nt6option1N14K_form__kexp_t(&src->t2, &dst->t2);
}

static void _fx_make_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_Nt6option1N14K_form__kexp_t* t2,
   struct _fx_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_Nt6option1N14K_form__kexp_t(t2, &fx_result->t2);
}

static void _fx_free_T2BN14K_form__ktyp_t(struct _fx_T2BN14K_form__ktyp_t* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2BN14K_form__ktyp_t(struct _fx_T2BN14K_form__ktyp_t* src, struct _fx_T2BN14K_form__ktyp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2BN14K_form__ktyp_t(
   bool t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_T2BN14K_form__ktyp_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t(
   struct _fx_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t0);
   _fx_free_LN14K_form__ktyp_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t(
   struct _fx_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t* src,
   struct _fx_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t(
   struct _fx_LN10Ast__pat_t_data_t* t0,
   struct _fx_LN14K_form__ktyp_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T2LN10Ast__pat_tLN14K_form__ktyp_t(struct _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t0);
   _fx_free_LN14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__pat_tLN14K_form__ktyp_t(
   struct _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t* src,
   struct _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__pat_tLN14K_form__ktyp_t(
   struct _fx_LN10Ast__pat_t_data_t* t0,
   struct _fx_LN14K_form__ktyp_t_data_t* t1,
   struct _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2N16Ast__defmodule_tLN14K_form__kexp_t(struct _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t* dst)
{
   _fx_free_N16Ast__defmodule_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2N16Ast__defmodule_tLN14K_form__kexp_t(
   struct _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t* src,
   struct _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N16Ast__defmodule_tLN14K_form__kexp_t(
   struct _fx_N16Ast__defmodule_t_data_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2N16Ast__defmodule_tLN14K_form__kexp_t(struct _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t, _fx_free_T2N16Ast__defmodule_tLN14K_form__kexp_t);
}

static int _fx_cons_LT2N16Ast__defmodule_tLN14K_form__kexp_t(
   struct _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t* hd,
   struct _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t, _fx_copy_T2N16Ast__defmodule_tLN14K_form__kexp_t);
}

_fx_Nt6option1R23K_normalize__pat_info_t _fx_g17K_normalize__None = { 1 };
_fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t _fx_g19K_normalize__None1_ = { 1 };
_fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t _fx_g19K_normalize__None2_ = { 1 };
_fx_Nt6option1N14K_form__kexp_t _fx_g19K_normalize__None3_ = { 1 };
_fx_Nt6option1R17K_form__ktprops_t _fx_g19K_normalize__None4_ = { 1 };
_fx_Nt6option1N14K_form__atom_t _fx_g19K_normalize__None5_ = { 1 };
_fx_Nt6option1R9Ast__id_t _fx_g19K_normalize__None6_ = { 1 };
_fx_Nt6option1N10Ast__exp_t _fx_g19K_normalize__None7_ = 0;
_fx_N12Set__color_t _fx_g16K_normalize__Red = { 1 };
_fx_N12Set__color_t _fx_g18K_normalize__Black = { 2 };
_fx_Nt11Set__tree_t1R9Ast__id_t _fx_g18K_normalize__Empty = 0;
static _fx_N10Ast__typ_t_data_t TypVoid_data_3 = { 1, 13 };
_fx_N10Ast__typ_t _fx_g20K_normalize__TypVoid = &TypVoid_data_3;
_fx_N12Ast__cmpop_t _fx_g18K_normalize__CmpEQ = { 1 };
_fx_N12Ast__cmpop_t _fx_g18K_normalize__CmpNE = { 2 };
static _fx_N13Ast__binary_t_data_t OpSub_data_2 = { 1, 2 };
_fx_N13Ast__binary_t _fx_g18K_normalize__OpSub = &OpSub_data_2;
static _fx_N13Ast__binary_t_data_t OpCons_data_2 = { 1, 26 };
_fx_N13Ast__binary_t _fx_g19K_normalize__OpCons = &OpCons_data_2;
_fx_N12Ast__unary_t _fx_g20K_normalize__OpDeref = { 7 };
_fx_N13Ast__intrin_t _fx_g25K_normalize__IntrinPopExn = { 1 };
_fx_N13Ast__intrin_t _fx_g29K_normalize__IntrinVariantTag = { 2 };
_fx_N13Ast__intrin_t _fx_g30K_normalize__IntrinVariantCase = { 3 };
_fx_N13Ast__intrin_t _fx_g27K_normalize__IntrinListHead = { 6 };
_fx_N13Ast__intrin_t _fx_g27K_normalize__IntrinListTail = { 7 };
_fx_N13Ast__intrin_t _fx_g28K_normalize__IntrinStrConcat = { 8 };
_fx_N13Ast__intrin_t _fx_g26K_normalize__IntrinGetSize = { 9 };
static _fx_N14K_form__ktyp_t_data_t KTypInt_data_1 = { 1, 1 };
_fx_N14K_form__ktyp_t _fx_g20K_normalize__KTypInt = &KTypInt_data_1;
static _fx_N14K_form__ktyp_t_data_t KTypCInt_data_0 = { 1, 2 };
_fx_N14K_form__ktyp_t _fx_g21K_normalize__KTypCInt = &KTypCInt_data_0;
static _fx_N14K_form__ktyp_t_data_t KTypLong_data_0 = { 1, 6 };
_fx_N14K_form__ktyp_t _fx_g21K_normalize__KTypLong = &KTypLong_data_0;
static _fx_N14K_form__ktyp_t_data_t KTypVoid_data_1 = { 1, 7 };
_fx_N14K_form__ktyp_t _fx_g21K_normalize__KTypVoid = &KTypVoid_data_1;
static _fx_N14K_form__ktyp_t_data_t KTypBool_data_1 = { 1, 8 };
_fx_N14K_form__ktyp_t _fx_g21K_normalize__KTypBool = &KTypBool_data_1;
static _fx_N14K_form__ktyp_t_data_t KTypChar_data_1 = { 1, 9 };
_fx_N14K_form__ktyp_t _fx_g21K_normalize__KTypChar = &KTypChar_data_1;
static _fx_N14K_form__ktyp_t_data_t KTypString_data_2 = { 1, 10 };
_fx_N14K_form__ktyp_t _fx_g23K_normalize__KTypString = &KTypString_data_2;
static _fx_N14K_form__ktyp_t_data_t KTypCPointer_data_0 = { 1, 11 };
_fx_N14K_form__ktyp_t _fx_g25K_normalize__KTypCPointer = &KTypCPointer_data_0;
static _fx_N14K_form__ktyp_t_data_t KTypExn_data_1 = { 1, 21 };
_fx_N14K_form__ktyp_t _fx_g20K_normalize__KTypExn = &KTypExn_data_1;
static _fx_N14K_form__ktyp_t_data_t KTypErr_data_1 = { 1, 22 };
_fx_N14K_form__ktyp_t _fx_g20K_normalize__KTypErr = &KTypErr_data_1;
static _fx_N14K_form__ktyp_t_data_t KTypModule_data_0 = { 1, 23 };
_fx_N14K_form__ktyp_t _fx_g23K_normalize__KTypModule = &KTypModule_data_0;
_fx_LT2N14K_form__atom_ti _fx_g29K_normalize__idx_access_stack = 0;
FX_EXTERN_C int _fx_M3AstFM6__eq__B2RM4id_tRM4id_t(
   struct _fx_R9Ast__id_t* a_0,
   struct _fx_R9Ast__id_t* b_0,
   bool* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_F4joinS2SLS(fx_str_t* sep_0, struct _fx_LS_data_t* strs_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C_VAL(fx_exn_t _fx_E15Set__RBSetErrorv)
static int _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(
   struct _fx_N10Ast__typ_t_data_t* t_0,
   struct _fx_rLR9Ast__id_t_data_t* id_stack_ref_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM9deref_typN10Ast__typ_t1N10Ast__typ_t(
   struct _fx_N10Ast__typ_t_data_t* t_0,
   struct _fx_N10Ast__typ_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11compile_errE2RM5loc_tS(
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* msg_0,
   fx_exn_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM8KTypSIntN14K_form__ktyp_t1i(int_ arg0, struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM8KTypUIntN14K_form__ktyp_t1i(int_ arg0, struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM9KTypFloatN14K_form__ktyp_t1i(int_ arg0, struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM8KTypListN14K_form__ktyp_t1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM9KTypTupleN14K_form__ktyp_t1LN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM7KTypRefN14K_form__ktyp_t1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM9KTypArrayN14K_form__ktyp_t2iN14K_form__ktyp_t(
   int_ arg0,
   struct _fx_N14K_form__ktyp_t_data_t* arg1,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM10KTypVectorN14K_form__ktyp_t1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM7KTypFunN14K_form__ktyp_t2LN14K_form__ktyp_tN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t* arg1,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C_VAL(struct _fx_R9Ast__id_t _fx_g9Ast__noid)
FX_EXTERN_C int _fx_M6K_formFM10KTypRecordN14K_form__ktyp_t2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* arg1,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M13Ast_typecheckFM17find_typ_instanceNt6option1N10Ast__typ_t2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__typ_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_Nt6option1N10Ast__typ_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM7id_infoN14Ast__id_info_t2RM4id_tRM5loc_t(
   struct _fx_R9Ast__id_t* i_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14Ast__id_info_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6stringS1RM4id_t(struct _fx_R9Ast__id_t* i_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM8KTypNameN14K_form__ktyp_t1R9Ast__id_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM7typ2strS1N10Ast__typ_t(struct _fx_N10Ast__typ_t_data_t* t_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C void _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(int64_t arg0, struct _fx_N14K_form__klit_t* fx_result);

FX_EXTERN_C void _fx_M6K_formFM8KLitSIntN14K_form__klit_t2il(int_ arg0, int64_t arg1, struct _fx_N14K_form__klit_t* fx_result);

FX_EXTERN_C void _fx_M6K_formFM8KLitUIntN14K_form__klit_t2iq(int_ arg0, uint64_t arg1, struct _fx_N14K_form__klit_t* fx_result);

FX_EXTERN_C void _fx_M6K_formFM9KLitFloatN14K_form__klit_t2id(int_ arg0, double arg1, struct _fx_N14K_form__klit_t* fx_result);

FX_EXTERN_C void _fx_M6K_formFM10KLitStringN14K_form__klit_t1S(fx_str_t* arg0, struct _fx_N14K_form__klit_t* fx_result);

FX_EXTERN_C void _fx_M6K_formFM8KLitCharN14K_form__klit_t1C(char_ arg0, struct _fx_N14K_form__klit_t* fx_result);

FX_EXTERN_C void _fx_M6K_formFM8KLitBoolN14K_form__klit_t1B(bool arg0, struct _fx_N14K_form__klit_t* fx_result);

FX_EXTERN_C void _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__klit_t* fx_result);

FX_EXTERN_C int _fx_M3AstFM2ppS1RM4id_t(struct _fx_R9Ast__id_t* i_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11curr_modulei1LN12Ast__scope_t(
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   int_* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11get_exp_ctxT2N10Ast__typ_tRM5loc_t1N10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM9KExpBreakN14K_form__kexp_t1R10Ast__loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM12KExpContinueN14K_form__kexp_t1R10Ast__loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   bool tref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM10KExpReturnN14K_form__kexp_t2Nt6option1N14K_form__atom_tR10Ast__loc_t(
   struct _fx_Nt6option1N14K_form__atom_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C_VAL(struct _fx_N14K_form__atom_t _fx_g17K_form___ALitVoid)
static int
   _fx_M11K_normalizeFM13process_rpartT2N14K_form__atom_tLN14K_form__kexp_t4Nt6option1N10Ast__exp_tLN14K_form__kexp_tN14K_form__atom_tLN12Ast__scope_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* e_opt_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_N14K_form__atom_t* defval_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C void _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(
   struct _fx_N14K_form__klit_t* arg0,
   struct _fx_N14K_form__atom_t* fx_result);

FX_EXTERN_C int _fx_M6K_formFM11KExpMkTupleN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LN14K_form__atom_t_data_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM7gen_idkR9Ast__id_t2iS(
   int_ m_idx_0,
   fx_str_t* s_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_N14K_form__ktyp_t_data_t* ktyp_0,
   struct _fx_R16Ast__val_flags_t* flags_0,
   struct _fx_Nt6option1N14K_form__kexp_t* e_opt_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C void _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N14K_form__atom_t* fx_result);

FX_EXTERN_C int _fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N15K_form__kinfo_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(
   struct _fx_R9Ast__id_t* i_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv);

FX_EXTERN_C_VAL(int FX_EXN_NotFoundError)
FX_EXTERN_C int _fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6K_formFM6KExpIfN14K_form__kexp_t4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t* arg2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg3,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M6K_formFM10KExpBinaryN14K_form__kexp_t4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N13Ast__binary_t_data_t* arg0,
   struct _fx_N14K_form__atom_t* arg1,
   struct _fx_N14K_form__atom_t* arg2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg3,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M11K_normalizeFM18arithm_subexp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   bool tref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM13get_atom_ktypN14K_form__ktyp_t2N14K_form__atom_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N13Ast__intrin_t* arg0,
   struct _fx_LN14K_form__atom_t_data_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M11K_normalizeFM6exp2idT2R9Ast__id_tLN14K_form__kexp_t5N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_tS(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   bool tref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   fx_str_t* msg_0,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM9KExpUnaryN14K_form__kexp_t3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N12Ast__unary_t* arg0,
   struct _fx_N14K_form__atom_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(
   int_ m_idx_0,
   fx_str_t* prefix_0,
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   bool tref_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM15new_block_scopeN12Ast__scope_t1i(int_ m_idx_0, struct _fx_N12Ast__scope_t* fx_result, void* fx_fv);

FX_EXTERN_C int
   _fx_M11K_normalizeFM28transform_all_types_and_consLN14K_form__kexp_t3LN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
   struct _fx_LN10Ast__exp_t_data_t* elist_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M11K_normalizeFM9eseq2codeT2LN14K_form__kexp_tLT2SR10Ast__loc_t3LN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
   struct _fx_LN10Ast__exp_t_data_t* eseq_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM8KExpSyncN14K_form__kexp_t2R9Ast__id_tN14K_form__kexp_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM11KExpMkArrayN14K_form__kexp_t3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   bool arg0,
   struct _fx_LLT2BN14K_form__atom_t_data_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM12KExpMkVectorN14K_form__kexp_t2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT2BN14K_form__atom_t_data_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M13Ast_typecheckFM16get_record_elemsT2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t4Nt6option1R9Ast__id_tN10Ast__typ_tBR10Ast__loc_t(
   struct _fx_Nt6option1R9Ast__id_t* vn_opt_0,
   struct _fx_N10Ast__typ_t_data_t* t_0,
   bool proto_mode_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM12KExpMkRecordN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LN14K_form__atom_t_data_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM8KExpCallN14K_form__kexp_t3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_LN14K_form__atom_t_data_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM7dup_idkR9Ast__id_t2iR9Ast__id_t(
   int_ m_idx_0,
   struct _fx_R9Ast__id_t* old_id_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   int_ arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM21default_tempref_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM12get_idk_ktypN14K_form__ktyp_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM18get_kinterface_optNt6option1rRM15kdefinterface_t2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_Nt6option1rR23K_form__kdefinterface_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM9KExpICallN14K_form__kexp_t4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   int_ arg1,
   struct _fx_LN14K_form__atom_t_data_t* arg2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg3,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM7kexp2idT2R9Ast__id_tLN14K_form__kexp_t6iSN14K_form__kexp_tBLN14K_form__kexp_tS(
   int_ m_idx_0,
   fx_str_t* prefix_0,
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   bool tref_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   fx_str_t* msg_0,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM9KExpThrowN14K_form__kexp_t3R9Ast__id_tBR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   bool arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM9KExpWhileN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM11KExpDoWhileN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

static int
   _fx_M11K_normalizeFM13transform_forT4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t7LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tLN14K_form__kexp_tLN12Ast__scope_tLN12Ast__scope_tR10Ast__loc_ti(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* pe_l_0,
   struct _fx_N10Ast__pat_t_data_t* idx_pat_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_LN12Ast__scope_t_data_t* body_sc_0,
   struct _fx_R10Ast__loc_t* eloc_0,
   int_ km_idx_0,
   struct _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6K_formFM7KExpForN14K_form__kexp_t5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* arg0,
   struct _fx_LR9Ast__id_t_data_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t* arg2,
   struct _fx_R16Ast__for_flags_t* arg3,
   struct _fx_R10Ast__loc_t* arg4,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M6K_formFM7KExpMapN14K_form__kexp_t4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_R16Ast__for_flags_t* arg2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg3,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11get_exp_typN10Ast__typ_t1N10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_N10Ast__typ_t_data_t** fx_result,
   void* fx_fv);

static int
   _fx_M11K_normalizeFM14cast_if_neededT2N14K_form__atom_tLN14K_form__kexp_t4N14K_form__atom_tLN14K_form__kexp_tR10Ast__loc_tLN12Ast__scope_t(
   struct _fx_N14K_form__atom_t* scalar_idx_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C void _fx_M6K_formFM10DomainElemN13K_form__dom_t1N14K_form__atom_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_N13K_form__dom_t* fx_result);

FX_EXTERN_C int
   _fx_M11K_normalizeFM7exp2domT2N13K_form__dom_tLN14K_form__kexp_t3N10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N13K_form__dom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6K_formFM6KExpAtN14K_form__kexp_t5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_N13Ast__border_t* arg1,
   struct _fx_N18Ast__interpolate_t* arg2,
   struct _fx_LN13K_form__dom_t_data_t* arg3,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg4,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_F6stringS1i(int_ a, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM9get_ifacerRM14definterface_t2RM4id_tRM5loc_t(
   struct _fx_R9Ast__id_t* iface_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_rR19Ast__definterface_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM7idk2strS2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* fx_result,
   void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_R9Ast__id_t _fx_g15Ast__std__tag__)
FX_EXTERN_C int
   _fx_M11K_normalizeFM18get_record_elems_kT2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t3Nt6option1R9Ast__id_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_Nt6option1R9Ast__id_t* vn_opt_0,
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__kdefval_t* fx_result,
   void* fx_fv);

FX_EXTERN_C void _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(
   struct _fx_R17K_form__kdefval_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result);

FX_EXTERN_C int _fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_N15K_form__kinfo_t* info_0,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM10KExpAssignN14K_form__kexp_t3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N14K_form__atom_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM8KExpCastN14K_form__kexp_t3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM9KExpCCodeN14K_form__kexp_t2ST2N14K_form__ktyp_tR10Ast__loc_t(
   fx_str_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M11K_normalizeFM10embed_dataN14K_form__kexp_t3SST2N14K_form__ktyp_tR10Ast__loc_t(
   fx_str_t* kind_0,
   fx_str_t* fname_0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM15is_mutable_atomB2N14K_form__atom_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M11K_normalizeFM22transform_pat_matchingT2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t6N14K_form__atom_tLT2N10Ast__pat_tN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_tB(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* cases_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool catch_mode_0,
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6K_formFM9KExpMatchN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM17default_val_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int
   _fx_M6K_formFM12KExpTryCatchN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6K_formFM12get_kexp_typN14K_form__ktyp_t1N14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   struct _fx_N14K_form__ktyp_t_data_t* ptyp_0,
   struct _fx_Nt6option1N14K_form__kexp_t* e_opt_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   fx_str_t* temp_prefix_0,
   struct _fx_R16Ast__val_flags_t* flags_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M11K_normalizeFM13transform_funLN14K_form__kexp_t3rR13Ast__deffun_tLN14K_form__kexp_tLN12Ast__scope_t(
   struct _fx_rR13Ast__deffun_t_data_t* df_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM14pat_skip_typedN10Ast__pat_t1N10Ast__pat_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   struct _fx_N10Ast__pat_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM7atom2idR9Ast__id_t3N14K_form__atom_tR10Ast__loc_tS(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* msg_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv);

FX_EXTERN_C void _fx_M6K_formFM11DomainRangeN13K_form__dom_t3N14K_form__atom_tN14K_form__atom_tN14K_form__atom_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_N14K_form__atom_t* arg1,
   struct _fx_N14K_form__atom_t* arg2,
   struct _fx_N13K_form__dom_t* fx_result);

static int
   _fx_M11K_normalizeFM10knorm_eseqLN14K_form__kexp_t4LN10Ast__exp_tLN14K_form__kexp_trLT2SR10Ast__loc_tLN12Ast__scope_t(
   struct _fx_LN10Ast__exp_t_data_t* eseq_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_rLT2SR10Ast__loc_t_data_t* pragmas_ref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   bool* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM10deref_ktypN14K_form__ktyp_t2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* kt_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM13get_bare_nameRM4id_t1RM4id_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM12get_kvariantrRM13kdefvariant_t2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_rR21K_form__kdefvariant_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6stringS1RM5loc_t(struct _fx_R10Ast__loc_t* loc_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C_VAL(int _FX_EXN_E17Ast__CompileError)
FX_EXTERN_C int _fx_M6K_formFM6stringS1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   fx_str_t* fx_result,
   void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_Rt6Set__t1R9Ast__id_t _fx_g16Ast__empty_idset)
static int
   _fx_M11K_normalizeFM19process_next_subpatTa2LN14K_form__kexp_t6Ta3LRM10pat_info_tTa2LN14K_form__kexp_tLN12Ast__scope_tirRt6Set__t1R9Ast__id_tLN12Ast__scope_t(
   struct _fx_Ta3LR23K_normalize__pat_info_t* plists_0,
   struct _fx_Ta2LN14K_form__kexp_t* arg1_0,
   struct _fx_LN12Ast__scope_t_data_t* case_sc_0,
   int_ km_idx_0,
   struct _fx_rRt6Set__t1R9Ast__id_t_data_t* match_var_cases_ref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_Ta2LN14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_R9Ast__id_t _fx_g32K_form__builtin_exn_NoMatchError)
FX_EXTERN_C int _fx_M6K_formFM14is_ktyp_scalarB1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* ktyp_0,
   bool* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM5OpCmpN13Ast__binary_t1N12Ast__cmpop_t(
   struct _fx_N12Ast__cmpop_t* arg0,
   struct _fx_N13Ast__binary_t_data_t** fx_result);

static int
   _fx_M11K_normalizeFM27get_var_tag_cmp_and_extractT5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t7R9Ast__id_tRM10pat_info_tTa2LN14K_form__kexp_tR9Ast__id_tLN12Ast__scope_tR10Ast__loc_ti(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R23K_normalize__pat_info_t* pinfo_0,
   struct _fx_Ta2LN14K_form__kexp_t* arg2_0,
   struct _fx_R9Ast__id_t* vn_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_R10Ast__loc_t* loc_0,
   int_ km_idx_0,
   struct _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_LN10Ast__exp_t_data_t* arg0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM17default_arg_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int
   _fx_M6K_formFM14create_kdeffunLN14K_form__kexp_t8R9Ast__id_tLR9Ast__id_tN14K_form__ktyp_tR16Ast__fun_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_LR9Ast__id_t_data_t* params_0,
   struct _fx_N14K_form__ktyp_t_data_t* rt_0,
   struct _fx_R16Ast__fun_flags_t* flags_0,
   struct _fx_Nt6option1N14K_form__kexp_t* body_opt_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM14get_idinfo_locRM5loc_t1N14Ast__id_info_t(
   struct _fx_N14Ast__id_info_t* id_info_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C void _fx_M6K_formFM4KTypN15K_form__kinfo_t1rRM9kdeftyp_t(
   struct _fx_rR17K_form__kdeftyp_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result);

FX_EXTERN_C int _fx_M6K_formFM7KDefTypN14K_form__kexp_t1rRM9kdeftyp_t(
   struct _fx_rR17K_form__kdeftyp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C void _fx_M6K_formFM8KVariantN15K_form__kinfo_t1rRM13kdefvariant_t(
   struct _fx_rR21K_form__kdefvariant_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result);

FX_EXTERN_C int _fx_M6K_formFM11KDefVariantN14K_form__kexp_t1rRM13kdefvariant_t(
   struct _fx_rR21K_form__kdefvariant_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C void _fx_M3AstFM11CtorVariantN17Ast__fun_constr_t1i(int_ arg0, struct _fx_N17Ast__fun_constr_t* fx_result);

FX_EXTERN_C int
   _fx_M6K_formFM17create_kdefconstrLN14K_form__kexp_t8R9Ast__id_tLN14K_form__ktyp_tN14K_form__ktyp_tN17Ast__fun_constr_tBLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_LN14K_form__ktyp_t_data_t* paramtyps_0,
   struct _fx_N14K_form__ktyp_t_data_t* rt_0,
   struct _fx_N17Ast__fun_constr_t* ctor_0,
   bool isinstance_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM15get_module_nameRM4id_t1i(int_ m_0, struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C bool _fx_F6__eq__B2SS(fx_str_t* a, fx_str_t* b, void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_R9Ast__id_t _fx_g35K_form__builtin_exn_OutOfRangeError)
FX_EXTERN_C int _fx_M3AstFM16get_module_scopeLN12Ast__scope_t1LN12Ast__scope_t(
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_LN12Ast__scope_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM8TypTupleN10Ast__typ_t1LN10Ast__typ_t(
   struct _fx_LN10Ast__typ_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C void _fx_M3AstFM7CtorExnN17Ast__fun_constr_t1RM4id_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N17Ast__fun_constr_t* fx_result);

FX_EXTERN_C void _fx_M6K_formFM4KExnN15K_form__kinfo_t1rRM9kdefexn_t(
   struct _fx_rR17K_form__kdefexn_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result);

FX_EXTERN_C int _fx_M6K_formFM7KDefExnN14K_form__kexp_t1rRM9kdefexn_t(
   struct _fx_rR17K_form__kdefexn_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM17default_var_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C void _fx_M6K_formFM10KInterfaceN15K_form__kinfo_t1rRM15kdefinterface_t(
   struct _fx_rR23K_form__kdefinterface_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result);

FX_EXTERN_C int _fx_M6K_formFM13KDefInterfaceN14K_form__kexp_t1rRM15kdefinterface_t(
   struct _fx_rR23K_form__kdefinterface_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M4FileFM9read_utf8S1S(fx_str_t* fname, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M4FileFM14read_binary_u8A1b1S(fx_str_t* fname_0, fx_arr_t* fx_result, void* fx_fv);

FX_EXTERN_C void _fx_M3AstFM8ScModuleN12Ast__scope_t1i(int_ arg0, struct _fx_N12Ast__scope_t* fx_result);

FX_EXTERN_C int _fx_M3AstFM13parse_pragmasRM9pragmas_t1LT2SRM5loc_t(
   struct _fx_LT2SR10Ast__loc_t_data_t* prl_0,
   struct _fx_R14Ast__pragmas_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM10get_moduleN16Ast__defmodule_t1i(
   int_ m_0,
   struct _fx_N16Ast__defmodule_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C void _fx_M11K_normalizeFM4SomeNt6option1RM10pat_info_t1RM10pat_info_t(
   struct _fx_R23K_normalize__pat_info_t* arg0,
   struct _fx_Nt6option1R23K_normalize__pat_info_t* fx_result)
{
   fx_result->tag = 2;
   _fx_copy_R23K_normalize__pat_info_t(arg0, &fx_result->u.Some);
}

FX_EXTERN_C void
   _fx_M11K_normalizeFM4SomeNt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(
   struct _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* arg0,
   struct _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* fx_result)
{
   fx_result->tag = 2;
   _fx_copy_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(arg0, &fx_result->u.Some);
}

FX_EXTERN_C void _fx_M11K_normalizeFM4SomeNt6option1T2R9Ast__id_tN10Ast__exp_t1T2R9Ast__id_tN10Ast__exp_t(
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* arg0,
   struct _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t* fx_result)
{
   fx_result->tag = 2;
   _fx_copy_T2R9Ast__id_tN10Ast__exp_t(arg0, &fx_result->u.Some);
}

FX_EXTERN_C void _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_Nt6option1N14K_form__kexp_t* fx_result)
{
   fx_result->tag = 2;
   FX_COPY_PTR(arg0, &fx_result->u.Some);
}

FX_EXTERN_C void _fx_M11K_normalizeFM4SomeNt6option1N14K_form__atom_t1N14K_form__atom_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_Nt6option1N14K_form__atom_t* fx_result)
{
   fx_result->tag = 2;
   _fx_copy_N14K_form__atom_t(arg0, &fx_result->u.Some);
}

FX_EXTERN_C void _fx_M11K_normalizeFM4SomeNt6option1R9Ast__id_t1R9Ast__id_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_Nt6option1R9Ast__id_t* fx_result)
{
   fx_result->tag = 2;
   fx_result->u.Some = *arg0;
}

FX_EXTERN_C int _fx_M11K_normalizeFM4SomeNt6option1N10Ast__exp_t1N10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_Nt6option1N10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt6option1N10Ast__exp_t);
   FX_COPY_PTR(arg0, &v->u.Some);
   return 0;
}

FX_EXTERN_C int _fx_M11K_normalizeFM6isnoneB1Nt6option1N14K_form__kexp_t(
   struct _fx_Nt6option1N14K_form__kexp_t* x_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (x_0->tag == 2) {
      *fx_result = false;
   }
   else {
      *fx_result = true;
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM6__ne__B2R9Ast__id_tR9Ast__id_t(
   struct _fx_R9Ast__id_t* a_0,
   struct _fx_R9Ast__id_t* b_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   bool res_0;
   FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(a_0, b_0, &res_0, 0), _fx_cleanup);
   *fx_result = !res_0;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int_ _fx_M11K_normalizeFM6lengthi1Li(struct _fx_Li_data_t* l, void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C int_ _fx_M11K_normalizeFM6lengthi1LT2R9Ast__id_tN10Ast__pat_t(
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* l,
   void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C int_ _fx_M11K_normalizeFM6lengthi1LN14K_form__ktyp_t(struct _fx_LN14K_form__ktyp_t_data_t* l, void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C int_ _fx_M11K_normalizeFM6lengthi1LT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* l,
   void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C int_ _fx_M11K_normalizeFM6lengthi1LN10Ast__pat_t(struct _fx_LN10Ast__pat_t_data_t* l, void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C int_ _fx_M11K_normalizeFM6lengthi1LN10Ast__exp_t(struct _fx_LN10Ast__exp_t_data_t* l, void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C int_ _fx_M11K_normalizeFM6lengthi1LN10Ast__typ_t(struct _fx_LN10Ast__typ_t_data_t* l, void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C void
   _fx_M11K_normalizeFM5link2LT2LN14K_form__kexp_tN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tLT2LN14K_form__kexp_tN14K_form__kexp_t(
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* l1,
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* l2,
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   
fx_link_lists(l1, l2, fx_result);

}

FX_EXTERN_C int
   _fx_M11K_normalizeFM7__add__LT2LN14K_form__kexp_tN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tLT2LN14K_form__kexp_tN14K_form__kexp_t(
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* l1_0,
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* l2_0,
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (l1_0 == 0) {
      FX_COPY_PTR(l2_0, fx_result);
   }
   else if (l2_0 == 0) {
      FX_COPY_PTR(l1_0, fx_result);
   }
   else {
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t v_0 = 0;
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t lstend_0 = 0;
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t lst_0 = l1_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* x_0 = &lst_0->hd;
         _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t node_0 = 0;
         FX_CALL(_fx_cons_LT2LN14K_form__kexp_tN14K_form__kexp_t(x_0, 0, false, &node_0), _fx_catch_0);
         FX_LIST_APPEND(v_0, lstend_0, node_0);

      _fx_catch_0: ;
         FX_CHECK_EXN(_fx_catch_1);
      }
      _fx_M11K_normalizeFM5link2LT2LN14K_form__kexp_tN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tLT2LN14K_form__kexp_tN14K_form__kexp_t(
         v_0, l2_0, fx_result, 0);

   _fx_catch_1: ;
      if (v_0) {
         _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&v_0);
      }
   }
   return fx_status;
}

FX_EXTERN_C void _fx_M11K_normalizeFM5link2LRM10pat_info_t2LRM10pat_info_tLRM10pat_info_t(
   struct _fx_LR23K_normalize__pat_info_t_data_t* l1,
   struct _fx_LR23K_normalize__pat_info_t_data_t* l2,
   struct _fx_LR23K_normalize__pat_info_t_data_t** fx_result,
   void* fx_fv)
{
   
fx_link_lists(l1, l2, fx_result);

}

FX_EXTERN_C void _fx_M11K_normalizeFM5link2LN14K_form__atom_t2LN14K_form__atom_tLN14K_form__atom_t(
   struct _fx_LN14K_form__atom_t_data_t* l1,
   struct _fx_LN14K_form__atom_t_data_t* l2,
   struct _fx_LN14K_form__atom_t_data_t** fx_result,
   void* fx_fv)
{
   
fx_link_lists(l1, l2, fx_result);

}

FX_EXTERN_C int _fx_M11K_normalizeFM7__add__LN14K_form__atom_t2LN14K_form__atom_tLN14K_form__atom_t(
   struct _fx_LN14K_form__atom_t_data_t* l1_0,
   struct _fx_LN14K_form__atom_t_data_t* l2_0,
   struct _fx_LN14K_form__atom_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (l1_0 == 0) {
      FX_COPY_PTR(l2_0, fx_result);
   }
   else if (l2_0 == 0) {
      FX_COPY_PTR(l1_0, fx_result);
   }
   else {
      _fx_LN14K_form__atom_t v_0 = 0;
      _fx_LN14K_form__atom_t lstend_0 = 0;
      _fx_LN14K_form__atom_t lst_0 = l1_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_N14K_form__atom_t* x_0 = &lst_0->hd;
         _fx_LN14K_form__atom_t node_0 = 0;
         FX_CALL(_fx_cons_LN14K_form__atom_t(x_0, 0, false, &node_0), _fx_catch_0);
         FX_LIST_APPEND(v_0, lstend_0, node_0);

      _fx_catch_0: ;
         FX_CHECK_EXN(_fx_catch_1);
      }
      _fx_M11K_normalizeFM5link2LN14K_form__atom_t2LN14K_form__atom_tLN14K_form__atom_t(v_0, l2_0, fx_result, 0);

   _fx_catch_1: ;
      if (v_0) {
         _fx_free_LN14K_form__atom_t(&v_0);
      }
   }
   return fx_status;
}

FX_EXTERN_C void _fx_M11K_normalizeFM5link2LN14K_form__kexp_t2LN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_LN14K_form__kexp_t_data_t* l1,
   struct _fx_LN14K_form__kexp_t_data_t* l2,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   
fx_link_lists(l1, l2, fx_result);

}

FX_EXTERN_C int _fx_M11K_normalizeFM7__add__LN14K_form__kexp_t2LN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_LN14K_form__kexp_t_data_t* l1_0,
   struct _fx_LN14K_form__kexp_t_data_t* l2_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (l1_0 == 0) {
      FX_COPY_PTR(l2_0, fx_result);
   }
   else if (l2_0 == 0) {
      FX_COPY_PTR(l1_0, fx_result);
   }
   else {
      _fx_LN14K_form__kexp_t v_0 = 0;
      _fx_LN14K_form__kexp_t lstend_0 = 0;
      _fx_LN14K_form__kexp_t lst_0 = l1_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_N14K_form__kexp_t x_0 = lst_0->hd;
         _fx_LN14K_form__kexp_t node_0 = 0;
         FX_CALL(_fx_cons_LN14K_form__kexp_t(x_0, 0, false, &node_0), _fx_catch_0);
         FX_LIST_APPEND(v_0, lstend_0, node_0);

      _fx_catch_0: ;
         FX_CHECK_EXN(_fx_catch_1);
      }
      _fx_M11K_normalizeFM5link2LN14K_form__kexp_t2LN14K_form__kexp_tLN14K_form__kexp_t(v_0, l2_0, fx_result, 0);

   _fx_catch_1: ;
      if (v_0) {
         _fx_free_LN14K_form__kexp_t(&v_0);
      }
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM6stringS1S(fx_str_t* a_0, fx_str_t* fx_result, void* fx_fv)
{
   int fx_status = 0;
   fx_copy_str(a_0, fx_result);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3inti1l(int64_t x_0, int_* fx_result, void* fx_fv)
{
   int fx_status = 0;
   *fx_result = (int_)x_0;
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM5int64l1i(int_ x_0, int64_t* fx_result, void* fx_fv)
{
   int fx_status = 0;
   *fx_result = (int64_t)x_0;
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM8length1_i1LT2R9Ast__id_tN10Ast__pat_t(
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* l_0,
   int_* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   *fx_result = _fx_M11K_normalizeFM6lengthi1LT2R9Ast__id_tN10Ast__pat_t(l_0, 0);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM8length1_i1LN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* l_0,
   int_* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   *fx_result = _fx_M11K_normalizeFM6lengthi1LN14K_form__ktyp_t(l_0, 0);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM8length1_i1LT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* l_0,
   int_* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   *fx_result = _fx_M11K_normalizeFM6lengthi1LT2R9Ast__id_tN14K_form__ktyp_t(l_0, 0);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM8length1_i1LN10Ast__pat_t(
   struct _fx_LN10Ast__pat_t_data_t* l_0,
   int_* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   *fx_result = _fx_M11K_normalizeFM6lengthi1LN10Ast__pat_t(l_0, 0);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM8length1_i1LN10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* l_0,
   int_* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   *fx_result = _fx_M11K_normalizeFM6lengthi1LN10Ast__exp_t(l_0, 0);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM2tlLT2N14K_form__atom_ti1LT2N14K_form__atom_ti(
   struct _fx_LT2N14K_form__atom_ti_data_t* __pat___0,
   struct _fx_LT2N14K_form__atom_ti_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (__pat___0 != 0) {
      FX_COPY_PTR(__pat___0->tl, fx_result);
   }
   else {
      FX_FAST_THROW(FX_EXN_NullListError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3nthN14K_form__atom_t2LN14K_form__atom_ti(
   struct _fx_LN14K_form__atom_t_data_t* l_0,
   int_ n_0,
   struct _fx_N14K_form__atom_t* fx_result,
   void* fx_fv)
{
   _fx_N14K_form__atom_t result_0 = {0};
   _fx_LN14K_form__atom_t l_1 = 0;
   int fx_status = 0;
   FX_COPY_PTR(l_0, &l_1);
   int_ n_1 = n_0;
   for (;;) {
      _fx_LN14K_form__atom_t l_2 = 0;
      FX_COPY_PTR(l_1, &l_2);
      int_ n_2 = n_1;
      if (l_2 != 0) {
         if (n_2 == 0) {
            _fx_N14K_form__atom_t* a_0 = &l_2->hd;
            _fx_free_N14K_form__atom_t(&result_0);
            _fx_copy_N14K_form__atom_t(a_0, &result_0);
            FX_BREAK(_fx_catch_0);
         }
         else {
            _fx_LN14K_form__atom_t* rest_0 = &l_2->tl;
            _fx_free_LN14K_form__atom_t(&l_1);
            FX_COPY_PTR(*rest_0, &l_1);
            n_1 = n_2 - 1;
         }

      _fx_catch_0: ;
      }
      else {
         FX_FAST_THROW(FX_EXN_OutOfRangeError, _fx_catch_1);
      }
      FX_CHECK_EXN(_fx_catch_1);

   _fx_catch_1: ;
      if (l_2) {
         _fx_free_LN14K_form__atom_t(&l_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_N14K_form__atom_t(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_N14K_form__atom_t(&result_0);
   if (l_1) {
      _fx_free_LN14K_form__atom_t(&l_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3revLN14K_form__ktyp_t1LN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* l_0,
   struct _fx_LN14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__ktyp_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LN14K_form__ktyp_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN14K_form__ktyp_t r_0 = 0;
      _fx_N14K_form__ktyp_t a_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LN14K_form__ktyp_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LN14K_form__ktyp_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LN14K_form__ktyp_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LN14K_form__ktyp_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3revLN13K_form__dom_t1LN13K_form__dom_t(
   struct _fx_LN13K_form__dom_t_data_t* l_0,
   struct _fx_LN13K_form__dom_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN13K_form__dom_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LN13K_form__dom_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN13K_form__dom_t r_0 = 0;
      _fx_N13K_form__dom_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LN13K_form__dom_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LN13K_form__dom_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LN13K_form__dom_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LN13K_form__dom_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM3revLT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t1LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* l_0,
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t r_0 = 0;
      _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3revLLT2BN14K_form__atom_t1LLT2BN14K_form__atom_t(
   struct _fx_LLT2BN14K_form__atom_t_data_t* l_0,
   struct _fx_LLT2BN14K_form__atom_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LLT2BN14K_form__atom_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LLT2BN14K_form__atom_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LLT2BN14K_form__atom_t r_0 = 0;
      _fx_LT2BN14K_form__atom_t a_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LLT2BN14K_form__atom_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LLT2BN14K_form__atom_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LLT2BN14K_form__atom_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LLT2BN14K_form__atom_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3revLN14K_form__atom_t1LN14K_form__atom_t(
   struct _fx_LN14K_form__atom_t_data_t* l_0,
   struct _fx_LN14K_form__atom_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__atom_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LN14K_form__atom_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN14K_form__atom_t r_0 = 0;
      _fx_N14K_form__atom_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LN14K_form__atom_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LN14K_form__atom_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LN14K_form__atom_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LN14K_form__atom_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3revLT2BN14K_form__atom_t1LT2BN14K_form__atom_t(
   struct _fx_LT2BN14K_form__atom_t_data_t* l_0,
   struct _fx_LT2BN14K_form__atom_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LT2BN14K_form__atom_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LT2BN14K_form__atom_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LT2BN14K_form__atom_t r_0 = 0;
      _fx_T2BN14K_form__atom_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LT2BN14K_form__atom_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LT2BN14K_form__atom_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LT2BN14K_form__atom_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LT2BN14K_form__atom_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3revLN14K_form__kexp_t1LN14K_form__kexp_t(
   struct _fx_LN14K_form__kexp_t_data_t* l_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__kexp_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LN14K_form__kexp_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN14K_form__kexp_t r_0 = 0;
      _fx_N14K_form__kexp_t a_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LN14K_form__kexp_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LN14K_form__kexp_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LN14K_form__kexp_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3revLN10Ast__exp_t1LN10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* l_0,
   struct _fx_LN10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN10Ast__exp_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LN10Ast__exp_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN10Ast__exp_t r_0 = 0;
      _fx_N10Ast__exp_t a_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LN10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LN10Ast__exp_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LN10Ast__exp_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LN10Ast__exp_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3revLN10Ast__pat_t1LN10Ast__pat_t(
   struct _fx_LN10Ast__pat_t_data_t* l_0,
   struct _fx_LN10Ast__pat_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN10Ast__pat_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LN10Ast__pat_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN10Ast__pat_t r_0 = 0;
      _fx_N10Ast__pat_t a_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LN10Ast__pat_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LN10Ast__pat_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LN10Ast__pat_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LN10Ast__pat_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3revLR9Ast__id_t1LR9Ast__id_t(
   struct _fx_LR9Ast__id_t_data_t* l_0,
   struct _fx_LR9Ast__id_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LR9Ast__id_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LR9Ast__id_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LR9Ast__id_t r_0 = 0;
      _fx_R9Ast__id_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LR9Ast__id_t(a_0, r_0, false, &r_0), _fx_catch_0);
      FX_FREE_LIST_SIMPLE(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      FX_FREE_LIST_SIMPLE(&r_0);
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   FX_FREE_LIST_SIMPLE(&__fold_result___0);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM6lengthi1S(fx_str_t* s_0, int_* fx_result, void* fx_fv)
{
   int fx_status = 0;
   *fx_result = FX_STR_LENGTH(*s_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM4joinS2SLS(fx_str_t* sep_0, struct _fx_LS_data_t* strs_0, fx_str_t* fx_result, void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(_fx_F4joinS2SLS(sep_0, strs_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
   struct _fx_N12Set__color_t* arg0,
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* arg1,
   struct _fx_R9Ast__id_t* arg2,
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* arg3,
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt11Set__tree_t1R9Ast__id_t);
   v->u.Node.t0 = *arg0;
   FX_COPY_PTR(arg1, &v->u.Node.t1);
   v->u.Node.t2 = *arg2;
   FX_COPY_PTR(arg3, &v->u.Node.t3);
   return 0;
}

FX_EXTERN_C int _fx_M11K_normalizeFM5emptyB1Rt6Set__t1R9Ast__id_t(
   struct _fx_Rt6Set__t1R9Ast__id_t* s_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if ((s_0->root != 0) + 1 == 1) {
      *fx_result = true;
   }
   else {
      *fx_result = false;
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM12balance_leftNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* l_0,
   struct _fx_R9Ast__id_t* x_0,
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* r_0,
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if ((l_0 != 0) + 1 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_0 = &l_0->u.Node;
      if (vcase_0->t0.tag == 1) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_0 = vcase_0->t1;
         if ((v_0 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_1 = &v_0->u.Node;
            if (vcase_1->t0.tag == 1) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_1 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t v_2 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, vcase_1->t1, &vcase_1->t2, vcase_1->t3, &v_1), _fx_catch_0);
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, vcase_0->t3, x_0, r_0, &v_2), _fx_catch_0);
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g16K_normalize__Red, v_1, &vcase_0->t2, v_2, fx_result), _fx_catch_0);

            _fx_catch_0: ;
               if (v_2) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_2);
               }
               if (v_1) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_1);
               }
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if ((l_0 != 0) + 1 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_2 = &l_0->u.Node;
      if (vcase_2->t0.tag == 1) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_3 = vcase_2->t3;
         if ((v_3 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_3 = &v_3->u.Node;
            if (vcase_3->t0.tag == 1) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_4 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t v_5 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, vcase_2->t1, &vcase_2->t2, vcase_3->t1, &v_4), _fx_catch_1);
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, vcase_3->t3, x_0, r_0, &v_5), _fx_catch_1);
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g16K_normalize__Red, v_4, &vcase_3->t2, v_5, fx_result), _fx_catch_1);

            _fx_catch_1: ;
               if (v_5) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_5);
               }
               if (v_4) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_4);
               }
               goto _fx_endmatch_0;
            }
         }
      }
   }
   FX_CALL(
      _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
         &_fx_g18K_normalize__Black, l_0, x_0, r_0, fx_result), _fx_catch_2);

_fx_catch_2: ;

_fx_endmatch_0: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM13balance_rightNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* l_0,
   struct _fx_R9Ast__id_t* x_0,
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* r_0,
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if ((r_0 != 0) + 1 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_0 = &r_0->u.Node;
      if (vcase_0->t0.tag == 1) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_0 = vcase_0->t1;
         if ((v_0 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_1 = &v_0->u.Node;
            if (vcase_1->t0.tag == 1) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_1 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t v_2 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, l_0, x_0, vcase_1->t1, &v_1), _fx_catch_0);
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, vcase_1->t3, &vcase_0->t2, vcase_0->t3, &v_2), _fx_catch_0);
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g16K_normalize__Red, v_1, &vcase_1->t2, v_2, fx_result), _fx_catch_0);

            _fx_catch_0: ;
               if (v_2) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_2);
               }
               if (v_1) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_1);
               }
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if ((r_0 != 0) + 1 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_2 = &r_0->u.Node;
      if (vcase_2->t0.tag == 1) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_3 = vcase_2->t3;
         if ((v_3 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_3 = &v_3->u.Node;
            if (vcase_3->t0.tag == 1) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_4 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t v_5 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, l_0, x_0, vcase_2->t1, &v_4), _fx_catch_1);
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, vcase_3->t1, &vcase_3->t2, vcase_3->t3, &v_5), _fx_catch_1);
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g16K_normalize__Red, v_4, &vcase_2->t2, v_5, fx_result), _fx_catch_1);

            _fx_catch_1: ;
               if (v_5) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_5);
               }
               if (v_4) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_4);
               }
               goto _fx_endmatch_0;
            }
         }
      }
   }
   FX_CALL(
      _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
         &_fx_g18K_normalize__Black, l_0, x_0, r_0, fx_result), _fx_catch_2);

_fx_catch_2: ;

_fx_endmatch_0: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM12add_to_tree_T2Nt11Set__tree_t1R9Ast__id_ti3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t_0,
   struct _fx_R9Ast__id_t* x_0,
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t* cmp_0,
   struct _fx_T2Nt11Set__tree_t1R9Ast__id_ti* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int tag_0 = (t_0 != 0) + 1;
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_0 = &t_0->u.Node;
      if (vcase_0->t0.tag == 1) {
         _fx_T2Nt11Set__tree_t1R9Ast__id_ti v_0 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t l_0 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t v_1 = 0;
         _fx_T2Nt11Set__tree_t1R9Ast__id_ti v_2 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t r_0 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t v_3 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t r_1 = vcase_0->t3;
         _fx_R9Ast__id_t* y_0 = &vcase_0->t2;
         _fx_Nt11Set__tree_t1R9Ast__id_t l_1 = vcase_0->t1;
         int_ c_0;
         FX_CALL(cmp_0->fp(x_0, y_0, &c_0, cmp_0->fcv), _fx_catch_0);
         if (c_0 < 0) {
            FX_CALL(
               _fx_M11K_normalizeFM12add_to_tree_T2Nt11Set__tree_t1R9Ast__id_ti3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
                  l_1, x_0, cmp_0, &v_0, 0), _fx_catch_0);
            FX_COPY_PTR(v_0.t0, &l_0);
            int_ dsz_0 = v_0.t1;
            FX_CALL(
               _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                  &_fx_g16K_normalize__Red, l_0, y_0, r_1, &v_1), _fx_catch_0);
            _fx_make_T2Nt11Set__tree_t1R9Ast__id_ti(v_1, dsz_0, fx_result);
         }
         else if (c_0 > 0) {
            FX_CALL(
               _fx_M11K_normalizeFM12add_to_tree_T2Nt11Set__tree_t1R9Ast__id_ti3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
                  r_1, x_0, cmp_0, &v_2, 0), _fx_catch_0);
            FX_COPY_PTR(v_2.t0, &r_0);
            int_ dsz_1 = v_2.t1;
            FX_CALL(
               _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                  &_fx_g16K_normalize__Red, l_1, y_0, r_0, &v_3), _fx_catch_0);
            _fx_make_T2Nt11Set__tree_t1R9Ast__id_ti(v_3, dsz_1, fx_result);
         }
         else {
            _fx_make_T2Nt11Set__tree_t1R9Ast__id_ti(t_0, 0, fx_result);
         }

      _fx_catch_0: ;
         if (v_3) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_3);
         }
         if (r_0) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&r_0);
         }
         _fx_free_T2Nt11Set__tree_t1R9Ast__id_ti(&v_2);
         if (v_1) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_1);
         }
         if (l_0) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&l_0);
         }
         _fx_free_T2Nt11Set__tree_t1R9Ast__id_ti(&v_0);
         goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_1 = &t_0->u.Node;
      if (vcase_1->t0.tag == 2) {
         _fx_T2Nt11Set__tree_t1R9Ast__id_ti v_4 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t l_2 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t v_5 = 0;
         _fx_T2Nt11Set__tree_t1R9Ast__id_ti v_6 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t r_2 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t v_7 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t r_3 = vcase_1->t3;
         _fx_R9Ast__id_t* y_1 = &vcase_1->t2;
         _fx_Nt11Set__tree_t1R9Ast__id_t l_3 = vcase_1->t1;
         int_ c_1;
         FX_CALL(cmp_0->fp(x_0, y_1, &c_1, cmp_0->fcv), _fx_catch_1);
         if (c_1 < 0) {
            FX_CALL(
               _fx_M11K_normalizeFM12add_to_tree_T2Nt11Set__tree_t1R9Ast__id_ti3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
                  l_3, x_0, cmp_0, &v_4, 0), _fx_catch_1);
            FX_COPY_PTR(v_4.t0, &l_2);
            int_ dsz_2 = v_4.t1;
            if (dsz_2 > 0) {
               FX_CALL(
                  _fx_M11K_normalizeFM12balance_leftNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     l_2, y_1, r_3, &v_5, 0), _fx_catch_1);
            }
            else {
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, l_2, y_1, r_3, &v_5), _fx_catch_1);
            }
            _fx_make_T2Nt11Set__tree_t1R9Ast__id_ti(v_5, dsz_2, fx_result);
         }
         else if (c_1 > 0) {
            FX_CALL(
               _fx_M11K_normalizeFM12add_to_tree_T2Nt11Set__tree_t1R9Ast__id_ti3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
                  r_3, x_0, cmp_0, &v_6, 0), _fx_catch_1);
            FX_COPY_PTR(v_6.t0, &r_2);
            int_ dsz_3 = v_6.t1;
            if (dsz_3 > 0) {
               FX_CALL(
                  _fx_M11K_normalizeFM13balance_rightNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     l_3, y_1, r_2, &v_7, 0), _fx_catch_1);
            }
            else {
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, l_3, y_1, r_2, &v_7), _fx_catch_1);
            }
            _fx_make_T2Nt11Set__tree_t1R9Ast__id_ti(v_7, dsz_3, fx_result);
         }
         else {
            _fx_make_T2Nt11Set__tree_t1R9Ast__id_ti(t_0, 0, fx_result);
         }

      _fx_catch_1: ;
         if (v_7) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_7);
         }
         if (r_2) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&r_2);
         }
         _fx_free_T2Nt11Set__tree_t1R9Ast__id_ti(&v_6);
         if (v_5) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_5);
         }
         if (l_2) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&l_2);
         }
         _fx_free_T2Nt11Set__tree_t1R9Ast__id_ti(&v_4);
         goto _fx_endmatch_0;
      }
   }
   _fx_Nt11Set__tree_t1R9Ast__id_t v_8 = 0;
   FX_CALL(
      _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
         &_fx_g16K_normalize__Red, _fx_g18K_normalize__Empty, x_0, _fx_g18K_normalize__Empty, &v_8), _fx_catch_2);
   _fx_make_T2Nt11Set__tree_t1R9Ast__id_ti(v_8, 1, fx_result);

_fx_catch_2: ;
   if (v_8) {
      _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_8);
   }

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3addRt6Set__t1R9Ast__id_t2Rt6Set__t1R9Ast__id_tR9Ast__id_t(
   struct _fx_Rt6Set__t1R9Ast__id_t* s_0,
   struct _fx_R9Ast__id_t* x_0,
   struct _fx_Rt6Set__t1R9Ast__id_t* fx_result,
   void* fx_fv)
{
   _fx_Nt11Set__tree_t1R9Ast__id_t v_0 = 0;
   _fx_FPi2R9Ast__id_tR9Ast__id_t v_1 = {0};
   _fx_T2Nt11Set__tree_t1R9Ast__id_ti v_2 = {0};
   _fx_Nt11Set__tree_t1R9Ast__id_t t_0 = 0;
   _fx_T2Nt11Set__tree_t1R9Ast__id_tB v_3 = {0};
   _fx_Nt11Set__tree_t1R9Ast__id_t t_1 = 0;
   _fx_FPi2R9Ast__id_tR9Ast__id_t v_4 = {0};
   int fx_status = 0;
   FX_COPY_PTR(s_0->root, &v_0);
   FX_COPY_FP(&s_0->cmp, &v_1);
   FX_CALL(
      _fx_M11K_normalizeFM12add_to_tree_T2Nt11Set__tree_t1R9Ast__id_ti3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
         v_0, x_0, &v_1, &v_2, 0), _fx_cleanup);
   FX_COPY_PTR(v_2.t0, &t_0);
   int_ dsz_0 = v_2.t1;
   if ((t_0 != 0) + 1 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_0 = &t_0->u.Node;
      if (vcase_0->t0.tag == 1) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_5 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
               &_fx_g18K_normalize__Black, vcase_0->t1, &vcase_0->t2, vcase_0->t3, &v_5), _fx_catch_0);
         _fx_make_T2Nt11Set__tree_t1R9Ast__id_tB(v_5, false, &v_3);

      _fx_catch_0: ;
         if (v_5) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_5);
         }
         goto _fx_endmatch_0;
      }
   }
   _fx_make_T2Nt11Set__tree_t1R9Ast__id_tB(t_0, true, &v_3);

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_3.t0, &t_1);
   FX_COPY_FP(&s_0->cmp, &v_4);
   _fx_make_Rt6Set__t1R9Ast__id_t(t_1, s_0->size + dsz_0, &v_4, fx_result);

_fx_cleanup: ;
   if (v_0) {
      _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_0);
   }
   FX_FREE_FP(&v_1);
   _fx_free_T2Nt11Set__tree_t1R9Ast__id_ti(&v_2);
   if (t_0) {
      _fx_free_Nt11Set__tree_t1R9Ast__id_t(&t_0);
   }
   _fx_free_T2Nt11Set__tree_t1R9Ast__id_tB(&v_3);
   if (t_1) {
      _fx_free_Nt11Set__tree_t1R9Ast__id_t(&t_1);
   }
   FX_FREE_FP(&v_4);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM15unbalanced_leftT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t_0,
   int_ dsz_0,
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tBi* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = (t_0 != 0) + 1;
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_0 = &t_0->u.Node;
      if (vcase_0->t0.tag == 1) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_0 = vcase_0->t1;
         if ((v_0 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_1 = &v_0->u.Node;
            if (vcase_1->t0.tag == 2) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_1 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t v_2 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g16K_normalize__Red, vcase_1->t1, &vcase_1->t2, vcase_1->t3, &v_1), _fx_catch_0);
               FX_CALL(
                  _fx_M11K_normalizeFM12balance_leftNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     v_1, &vcase_0->t2, vcase_0->t3, &v_2, 0), _fx_catch_0);
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(v_2, false, dsz_0, fx_result);

            _fx_catch_0: ;
               if (v_2) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_2);
               }
               if (v_1) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_1);
               }
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_2 = &t_0->u.Node;
      if (vcase_2->t0.tag == 2) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_3 = vcase_2->t1;
         if ((v_3 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_3 = &v_3->u.Node;
            if (vcase_3->t0.tag == 2) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_4 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t v_5 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g16K_normalize__Red, vcase_3->t1, &vcase_3->t2, vcase_3->t3, &v_4), _fx_catch_1);
               FX_CALL(
                  _fx_M11K_normalizeFM12balance_leftNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     v_4, &vcase_2->t2, vcase_2->t3, &v_5, 0), _fx_catch_1);
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(v_5, true, dsz_0, fx_result);

            _fx_catch_1: ;
               if (v_5) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_5);
               }
               if (v_4) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_4);
               }
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_4 = &t_0->u.Node;
      if (vcase_4->t0.tag == 2) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_6 = vcase_4->t1;
         if ((v_6 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_5 = &v_6->u.Node;
            if (vcase_5->t0.tag == 1) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_7 = vcase_5->t3;
               if ((v_7 != 0) + 1 == 2) {
                  _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_6 =
                     &v_7->u.Node;
                  if (vcase_6->t0.tag == 2) {
                     _fx_Nt11Set__tree_t1R9Ast__id_t v_8 = 0;
                     _fx_Nt11Set__tree_t1R9Ast__id_t v_9 = 0;
                     _fx_Nt11Set__tree_t1R9Ast__id_t v_10 = 0;
                     FX_CALL(
                        _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                           &_fx_g16K_normalize__Red, vcase_6->t1, &vcase_6->t2, vcase_6->t3, &v_8), _fx_catch_2);
                     FX_CALL(
                        _fx_M11K_normalizeFM12balance_leftNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                           v_8, &vcase_4->t2, vcase_4->t3, &v_9, 0), _fx_catch_2);
                     FX_CALL(
                        _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                           &_fx_g18K_normalize__Black, vcase_5->t1, &vcase_5->t2, v_9, &v_10), _fx_catch_2);
                     _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(v_10, false, dsz_0, fx_result);

                  _fx_catch_2: ;
                     if (v_10) {
                        _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_10);
                     }
                     if (v_9) {
                        _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_9);
                     }
                     if (v_8) {
                        _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_8);
                     }
                     goto _fx_endmatch_0;
                  }
               }
            }
         }
      }
   }
   FX_THROW(&_fx_E15Set__RBSetErrorv, false, _fx_cleanup);

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM16unbalanced_rightT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t_0,
   int_ dsz_0,
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tBi* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = (t_0 != 0) + 1;
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_0 = &t_0->u.Node;
      if (vcase_0->t0.tag == 1) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_0 = vcase_0->t3;
         if ((v_0 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_1 = &v_0->u.Node;
            if (vcase_1->t0.tag == 2) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_1 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t v_2 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g16K_normalize__Red, vcase_1->t1, &vcase_1->t2, vcase_1->t3, &v_1), _fx_catch_0);
               FX_CALL(
                  _fx_M11K_normalizeFM13balance_rightNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     vcase_0->t1, &vcase_0->t2, v_1, &v_2, 0), _fx_catch_0);
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(v_2, false, dsz_0, fx_result);

            _fx_catch_0: ;
               if (v_2) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_2);
               }
               if (v_1) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_1);
               }
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_2 = &t_0->u.Node;
      if (vcase_2->t0.tag == 2) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_3 = vcase_2->t3;
         if ((v_3 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_3 = &v_3->u.Node;
            if (vcase_3->t0.tag == 2) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_4 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t v_5 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g16K_normalize__Red, vcase_3->t1, &vcase_3->t2, vcase_3->t3, &v_4), _fx_catch_1);
               FX_CALL(
                  _fx_M11K_normalizeFM13balance_rightNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     vcase_2->t1, &vcase_2->t2, v_4, &v_5, 0), _fx_catch_1);
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(v_5, true, dsz_0, fx_result);

            _fx_catch_1: ;
               if (v_5) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_5);
               }
               if (v_4) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_4);
               }
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_4 = &t_0->u.Node;
      if (vcase_4->t0.tag == 2) {
         _fx_Nt11Set__tree_t1R9Ast__id_t v_6 = vcase_4->t3;
         if ((v_6 != 0) + 1 == 2) {
            _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_5 = &v_6->u.Node;
            if (vcase_5->t0.tag == 1) {
               _fx_Nt11Set__tree_t1R9Ast__id_t v_7 = vcase_5->t1;
               if ((v_7 != 0) + 1 == 2) {
                  _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_6 =
                     &v_7->u.Node;
                  if (vcase_6->t0.tag == 2) {
                     _fx_Nt11Set__tree_t1R9Ast__id_t v_8 = 0;
                     _fx_Nt11Set__tree_t1R9Ast__id_t v_9 = 0;
                     _fx_Nt11Set__tree_t1R9Ast__id_t v_10 = 0;
                     FX_CALL(
                        _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                           &_fx_g16K_normalize__Red, vcase_6->t1, &vcase_6->t2, vcase_6->t3, &v_8), _fx_catch_2);
                     FX_CALL(
                        _fx_M11K_normalizeFM13balance_rightNt11Set__tree_t1R9Ast__id_t3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                           vcase_4->t1, &vcase_4->t2, v_8, &v_9, 0), _fx_catch_2);
                     FX_CALL(
                        _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                           &_fx_g18K_normalize__Black, v_9, &vcase_5->t2, vcase_5->t3, &v_10), _fx_catch_2);
                     _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(v_10, false, dsz_0, fx_result);

                  _fx_catch_2: ;
                     if (v_10) {
                        _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_10);
                     }
                     if (v_9) {
                        _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_9);
                     }
                     if (v_8) {
                        _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_8);
                     }
                     goto _fx_endmatch_0;
                  }
               }
            }
         }
      }
   }
   FX_THROW(&_fx_E15Set__RBSetErrorv, false, _fx_cleanup);

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM10remove_minT3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB1Nt11Set__tree_t1R9Ast__id_t(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t_0,
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int tag_0 = (t_0 != 0) + 1;
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_0 = &t_0->u.Node;
      if (vcase_0->t0.tag == 2) {
         if ((vcase_0->t1 != 0) + 1 == 1) {
            if ((vcase_0->t3 != 0) + 1 == 1) {
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(_fx_g18K_normalize__Empty, &vcase_0->t2, true, fx_result);
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_1 = &t_0->u.Node;
      if (vcase_1->t0.tag == 2) {
         if ((vcase_1->t1 != 0) + 1 == 1) {
            _fx_Nt11Set__tree_t1R9Ast__id_t v_0 = vcase_1->t3;
            if ((v_0 != 0) + 1 == 2) {
               _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_2 = &v_0->u.Node;
               if (vcase_2->t0.tag == 1) {
                  _fx_Nt11Set__tree_t1R9Ast__id_t v_1 = 0;
                  FX_CALL(
                     _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                        &_fx_g18K_normalize__Black, vcase_2->t1, &vcase_2->t2, vcase_2->t3, &v_1), _fx_catch_0);
                  _fx_make_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(v_1, &vcase_1->t2, false, fx_result);

               _fx_catch_0: ;
                  if (v_1) {
                     _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_1);
                  }
                  goto _fx_endmatch_0;
               }
            }
         }
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_3 = &t_0->u.Node;
      if (vcase_3->t0.tag == 1) {
         if ((vcase_3->t1 != 0) + 1 == 1) {
            _fx_make_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(vcase_3->t3, &vcase_3->t2, false, fx_result);
            goto _fx_endmatch_0;
         }
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_4 = &t_0->u.Node;
      if (vcase_4->t0.tag == 2) {
         _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB v_2 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t l_0 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t s_0 = 0;
         _fx_T3Nt11Set__tree_t1R9Ast__id_tBi v_3 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t s_1 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM10remove_minT3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB1Nt11Set__tree_t1R9Ast__id_t(vcase_4->t1,
               &v_2, 0), _fx_catch_1);
         FX_COPY_PTR(v_2.t0, &l_0);
         _fx_R9Ast__id_t y_0 = v_2.t1;
         bool d_0 = v_2.t2;
         FX_CALL(
            _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
               &_fx_g18K_normalize__Black, l_0, &vcase_4->t2, vcase_4->t3, &s_0), _fx_catch_1);
         if (d_0) {
            FX_CALL(
               _fx_M11K_normalizeFM16unbalanced_rightT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(s_0, 0, &v_3,
                  0), _fx_catch_1);
            FX_COPY_PTR(v_3.t0, &s_1);
            bool d_1 = v_3.t1;
            _fx_make_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(s_1, &y_0, d_1, fx_result);
         }
         else {
            _fx_make_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(s_0, &y_0, false, fx_result);
         }

      _fx_catch_1: ;
         if (s_1) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_1);
         }
         _fx_free_T3Nt11Set__tree_t1R9Ast__id_tBi(&v_3);
         if (s_0) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_0);
         }
         if (l_0) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&l_0);
         }
         _fx_free_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(&v_2);
         goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_5 = &t_0->u.Node;
      if (vcase_5->t0.tag == 1) {
         _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB v_4 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t l_1 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t s_2 = 0;
         _fx_T3Nt11Set__tree_t1R9Ast__id_tBi v_5 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t s_3 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM10remove_minT3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB1Nt11Set__tree_t1R9Ast__id_t(vcase_5->t1,
               &v_4, 0), _fx_catch_2);
         FX_COPY_PTR(v_4.t0, &l_1);
         _fx_R9Ast__id_t y_1 = v_4.t1;
         bool d_2 = v_4.t2;
         FX_CALL(
            _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
               &_fx_g16K_normalize__Red, l_1, &vcase_5->t2, vcase_5->t3, &s_2), _fx_catch_2);
         if (d_2) {
            FX_CALL(
               _fx_M11K_normalizeFM16unbalanced_rightT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(s_2, 0, &v_5,
                  0), _fx_catch_2);
            FX_COPY_PTR(v_5.t0, &s_3);
            bool d_3 = v_5.t1;
            _fx_make_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(s_3, &y_1, d_3, fx_result);
         }
         else {
            _fx_make_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(s_2, &y_1, false, fx_result);
         }

      _fx_catch_2: ;
         if (s_3) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_3);
         }
         _fx_free_T3Nt11Set__tree_t1R9Ast__id_tBi(&v_5);
         if (s_2) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_2);
         }
         if (l_1) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&l_1);
         }
         _fx_free_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(&v_4);
         goto _fx_endmatch_0;
      }
   }
   FX_THROW(&_fx_E15Set__RBSetErrorv, false, _fx_cleanup);

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM7remove_T3Nt11Set__tree_t1R9Ast__id_tBi3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t_0,
   struct _fx_R9Ast__id_t* x_0,
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t* cmp_0,
   struct _fx_T3Nt11Set__tree_t1R9Ast__id_tBi* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int tag_0 = (t_0 != 0) + 1;
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_0 = &t_0->u.Node;
      if (vcase_0->t0.tag == 2) {
         _fx_T3Nt11Set__tree_t1R9Ast__id_tBi v_0 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t l_0 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t s_0 = 0;
         _fx_T3Nt11Set__tree_t1R9Ast__id_tBi v_1 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t r_0 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t s_1 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t r_1 = vcase_0->t3;
         _fx_R9Ast__id_t* y_0 = &vcase_0->t2;
         _fx_Nt11Set__tree_t1R9Ast__id_t l_1 = vcase_0->t1;
         int_ c_0;
         FX_CALL(cmp_0->fp(x_0, y_0, &c_0, cmp_0->fcv), _fx_catch_3);
         if (c_0 < 0) {
            FX_CALL(
               _fx_M11K_normalizeFM7remove_T3Nt11Set__tree_t1R9Ast__id_tBi3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
                  l_1, x_0, cmp_0, &v_0, 0), _fx_catch_3);
            FX_COPY_PTR(v_0.t0, &l_0);
            bool d_0 = v_0.t1;
            int_ dsz_0 = v_0.t2;
            FX_CALL(
               _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                  &_fx_g18K_normalize__Black, l_0, y_0, r_1, &s_0), _fx_catch_3);
            if (d_0) {
               FX_CALL(
                  _fx_M11K_normalizeFM16unbalanced_rightT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(s_0, dsz_0,
                     fx_result, 0), _fx_catch_3);
            }
            else {
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(s_0, false, dsz_0, fx_result);
            }
         }
         else if (c_0 > 0) {
            FX_CALL(
               _fx_M11K_normalizeFM7remove_T3Nt11Set__tree_t1R9Ast__id_tBi3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
                  r_1, x_0, cmp_0, &v_1, 0), _fx_catch_3);
            FX_COPY_PTR(v_1.t0, &r_0);
            bool d_1 = v_1.t1;
            int_ dsz_1 = v_1.t2;
            FX_CALL(
               _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                  &_fx_g18K_normalize__Black, l_1, y_0, r_0, &s_1), _fx_catch_3);
            if (d_1) {
               FX_CALL(
                  _fx_M11K_normalizeFM15unbalanced_leftT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(s_1, dsz_1,
                     fx_result, 0), _fx_catch_3);
            }
            else {
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(s_1, false, dsz_1, fx_result);
            }
         }
         else {
            if ((r_1 != 0) + 1 == 1) {
               _fx_T2Nt11Set__tree_t1R9Ast__id_tB v_2 = {0};
               _fx_Nt11Set__tree_t1R9Ast__id_t l_2 = 0;
               if ((l_1 != 0) + 1 == 2) {
                  _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_1 =
                     &l_1->u.Node;
                  if (vcase_1->t0.tag == 1) {
                     _fx_Nt11Set__tree_t1R9Ast__id_t v_3 = 0;
                     FX_CALL(
                        _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                           &_fx_g18K_normalize__Black, vcase_1->t1, &vcase_1->t2, vcase_1->t3, &v_3), _fx_catch_0);
                     _fx_make_T2Nt11Set__tree_t1R9Ast__id_tB(v_3, false, &v_2);

                  _fx_catch_0: ;
                     if (v_3) {
                        _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_3);
                     }
                     goto _fx_endmatch_0;
                  }
               }
               _fx_make_T2Nt11Set__tree_t1R9Ast__id_tB(l_1, true, &v_2);

            _fx_endmatch_0: ;
               FX_CHECK_EXN(_fx_catch_1);
               FX_COPY_PTR(v_2.t0, &l_2);
               bool d_2 = v_2.t1;
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(l_2, d_2, -1, fx_result);

            _fx_catch_1: ;
               if (l_2) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&l_2);
               }
               _fx_free_T2Nt11Set__tree_t1R9Ast__id_tB(&v_2);
            }
            else {
               _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB v_4 = {0};
               _fx_Nt11Set__tree_t1R9Ast__id_t r_2 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t s_2 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM10remove_minT3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB1Nt11Set__tree_t1R9Ast__id_t(r_1,
                     &v_4, 0), _fx_catch_2);
               FX_COPY_PTR(v_4.t0, &r_2);
               _fx_R9Ast__id_t y_1 = v_4.t1;
               bool d_3 = v_4.t2;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g18K_normalize__Black, l_1, &y_1, r_2, &s_2), _fx_catch_2);
               if (d_3) {
                  FX_CALL(
                     _fx_M11K_normalizeFM15unbalanced_leftT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(s_2, -1,
                        fx_result, 0), _fx_catch_2);
               }
               else {
                  _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(s_2, false, -1, fx_result);
               }

            _fx_catch_2: ;
               if (s_2) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_2);
               }
               if (r_2) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&r_2);
               }
               _fx_free_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(&v_4);
            }
            FX_CHECK_EXN(_fx_catch_3);
         }

      _fx_catch_3: ;
         if (s_1) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_1);
         }
         if (r_0) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&r_0);
         }
         _fx_free_T3Nt11Set__tree_t1R9Ast__id_tBi(&v_1);
         if (s_0) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_0);
         }
         if (l_0) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&l_0);
         }
         _fx_free_T3Nt11Set__tree_t1R9Ast__id_tBi(&v_0);
         goto _fx_endmatch_1;
      }
   }
   if (tag_0 == 2) {
      _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_2 = &t_0->u.Node;
      if (vcase_2->t0.tag == 1) {
         _fx_T3Nt11Set__tree_t1R9Ast__id_tBi v_5 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t l_3 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t s_3 = 0;
         _fx_T3Nt11Set__tree_t1R9Ast__id_tBi v_6 = {0};
         _fx_Nt11Set__tree_t1R9Ast__id_t r_3 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t s_4 = 0;
         _fx_Nt11Set__tree_t1R9Ast__id_t r_4 = vcase_2->t3;
         _fx_R9Ast__id_t* y_2 = &vcase_2->t2;
         _fx_Nt11Set__tree_t1R9Ast__id_t l_4 = vcase_2->t1;
         int_ c_1;
         FX_CALL(cmp_0->fp(x_0, y_2, &c_1, cmp_0->fcv), _fx_catch_5);
         if (c_1 < 0) {
            FX_CALL(
               _fx_M11K_normalizeFM7remove_T3Nt11Set__tree_t1R9Ast__id_tBi3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
                  l_4, x_0, cmp_0, &v_5, 0), _fx_catch_5);
            FX_COPY_PTR(v_5.t0, &l_3);
            bool d_4 = v_5.t1;
            int_ dsz_2 = v_5.t2;
            FX_CALL(
               _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                  &_fx_g16K_normalize__Red, l_3, y_2, r_4, &s_3), _fx_catch_5);
            if (d_4) {
               FX_CALL(
                  _fx_M11K_normalizeFM16unbalanced_rightT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(s_3, dsz_2,
                     fx_result, 0), _fx_catch_5);
            }
            else {
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(s_3, false, dsz_2, fx_result);
            }
         }
         else if (c_1 > 0) {
            FX_CALL(
               _fx_M11K_normalizeFM7remove_T3Nt11Set__tree_t1R9Ast__id_tBi3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
                  r_4, x_0, cmp_0, &v_6, 0), _fx_catch_5);
            FX_COPY_PTR(v_6.t0, &r_3);
            bool d_5 = v_6.t1;
            int_ dsz_3 = v_6.t2;
            FX_CALL(
               _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                  &_fx_g16K_normalize__Red, l_4, y_2, r_3, &s_4), _fx_catch_5);
            if (d_5) {
               FX_CALL(
                  _fx_M11K_normalizeFM15unbalanced_leftT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(s_4, dsz_3,
                     fx_result, 0), _fx_catch_5);
            }
            else {
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(s_4, false, dsz_3, fx_result);
            }
         }
         else {
            if ((r_4 != 0) + 1 == 1) {
               _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(l_4, false, -1, fx_result);
            }
            else {
               _fx_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB v_7 = {0};
               _fx_Nt11Set__tree_t1R9Ast__id_t r_5 = 0;
               _fx_Nt11Set__tree_t1R9Ast__id_t s_5 = 0;
               FX_CALL(
                  _fx_M11K_normalizeFM10remove_minT3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB1Nt11Set__tree_t1R9Ast__id_t(r_4,
                     &v_7, 0), _fx_catch_4);
               FX_COPY_PTR(v_7.t0, &r_5);
               _fx_R9Ast__id_t y_3 = v_7.t1;
               bool d_6 = v_7.t2;
               FX_CALL(
                  _fx_M11K_normalizeFM4NodeNt11Set__tree_t1R9Ast__id_t4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t(
                     &_fx_g16K_normalize__Red, l_4, &y_3, r_5, &s_5), _fx_catch_4);
               if (d_6) {
                  FX_CALL(
                     _fx_M11K_normalizeFM15unbalanced_leftT3Nt11Set__tree_t1R9Ast__id_tBi2Nt11Set__tree_t1R9Ast__id_ti(s_5, -1,
                        fx_result, 0), _fx_catch_4);
               }
               else {
                  _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(s_5, false, -1, fx_result);
               }

            _fx_catch_4: ;
               if (s_5) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_5);
               }
               if (r_5) {
                  _fx_free_Nt11Set__tree_t1R9Ast__id_t(&r_5);
               }
               _fx_free_T3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tB(&v_7);
            }
            FX_CHECK_EXN(_fx_catch_5);
         }

      _fx_catch_5: ;
         if (s_4) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_4);
         }
         if (r_3) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&r_3);
         }
         _fx_free_T3Nt11Set__tree_t1R9Ast__id_tBi(&v_6);
         if (s_3) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&s_3);
         }
         if (l_3) {
            _fx_free_Nt11Set__tree_t1R9Ast__id_t(&l_3);
         }
         _fx_free_T3Nt11Set__tree_t1R9Ast__id_tBi(&v_5);
         goto _fx_endmatch_1;
      }
   }
   _fx_make_T3Nt11Set__tree_t1R9Ast__id_tBi(_fx_g18K_normalize__Empty, false, 0, fx_result);

_fx_endmatch_1: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM6removeRt6Set__t1R9Ast__id_t2Rt6Set__t1R9Ast__id_tR9Ast__id_t(
   struct _fx_Rt6Set__t1R9Ast__id_t* s_0,
   struct _fx_R9Ast__id_t* x_0,
   struct _fx_Rt6Set__t1R9Ast__id_t* fx_result,
   void* fx_fv)
{
   _fx_Nt11Set__tree_t1R9Ast__id_t v_0 = 0;
   _fx_FPi2R9Ast__id_tR9Ast__id_t v_1 = {0};
   _fx_T3Nt11Set__tree_t1R9Ast__id_tBi v_2 = {0};
   _fx_Nt11Set__tree_t1R9Ast__id_t new_root_0 = 0;
   _fx_FPi2R9Ast__id_tR9Ast__id_t v_3 = {0};
   int fx_status = 0;
   FX_COPY_PTR(s_0->root, &v_0);
   FX_COPY_FP(&s_0->cmp, &v_1);
   FX_CALL(
      _fx_M11K_normalizeFM7remove_T3Nt11Set__tree_t1R9Ast__id_tBi3Nt11Set__tree_t1R9Ast__id_tR9Ast__id_tFPi2R9Ast__id_tR9Ast__id_t(
         v_0, x_0, &v_1, &v_2, 0), _fx_cleanup);
   FX_COPY_PTR(v_2.t0, &new_root_0);
   int_ dsz_0 = v_2.t2;
   FX_COPY_FP(&s_0->cmp, &v_3);
   _fx_make_Rt6Set__t1R9Ast__id_t(new_root_0, s_0->size + dsz_0, &v_3, fx_result);

_fx_cleanup: ;
   if (v_0) {
      _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_0);
   }
   FX_FREE_FP(&v_1);
   _fx_free_T3Nt11Set__tree_t1R9Ast__id_tBi(&v_2);
   if (new_root_0) {
      _fx_free_Nt11Set__tree_t1R9Ast__id_t(&new_root_0);
   }
   FX_FREE_FP(&v_3);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM12update_list_LS3Nt11Set__tree_t1R9Ast__id_tFPS1R9Ast__id_tLS(
   struct _fx_Nt11Set__tree_t1R9Ast__id_t_data_t* t_0,
   struct _fx_FPS1R9Ast__id_t* f_0,
   struct _fx_LS_data_t* res_0,
   struct _fx_LS_data_t** fx_result,
   void* fx_fv)
{
   _fx_LS result_0 = 0;
   _fx_Nt11Set__tree_t1R9Ast__id_t t_1 = 0;
   _fx_FPS1R9Ast__id_t f_1 = {0};
   _fx_LS res_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(t_0, &t_1);
   FX_COPY_FP(f_0, &f_1);
   FX_COPY_PTR(res_0, &res_1);
   for (;;) {
      _fx_Nt11Set__tree_t1R9Ast__id_t t_2 = 0;
      _fx_FPS1R9Ast__id_t f_2 = {0};
      _fx_LS res_2 = 0;
      FX_COPY_PTR(t_1, &t_2);
      FX_COPY_FP(&f_1, &f_2);
      FX_COPY_PTR(res_1, &res_2);
      if ((t_2 != 0) + 1 == 2) {
         fx_str_t v_0 = {0};
         _fx_LS v_1 = 0;
         _fx_LS v_2 = 0;
         _fx_T4N12Set__color_tNt11Set__tree_t1R9Ast__id_tR9Ast__id_tNt11Set__tree_t1R9Ast__id_t* vcase_0 = &t_2->u.Node;
         FX_CALL(f_2.fp(&vcase_0->t2, &v_0, f_2.fcv), _fx_catch_0);
         FX_CALL(
            _fx_M11K_normalizeFM12update_list_LS3Nt11Set__tree_t1R9Ast__id_tFPS1R9Ast__id_tLS(vcase_0->t3, &f_2, res_2, &v_1,
               0), _fx_catch_0);
         FX_CALL(_fx_cons_LS(&v_0, v_1, true, &v_2), _fx_catch_0);
         _fx_Nt11Set__tree_t1R9Ast__id_t* l_0 = &vcase_0->t1;
         _fx_free_Nt11Set__tree_t1R9Ast__id_t(&t_1);
         FX_COPY_PTR(*l_0, &t_1);
         FX_FREE_FP(&f_1);
         FX_COPY_FP(&f_2, &f_1);
         _fx_free_LS(&res_1);
         FX_COPY_PTR(v_2, &res_1);

      _fx_catch_0: ;
         if (v_2) {
            _fx_free_LS(&v_2);
         }
         if (v_1) {
            _fx_free_LS(&v_1);
         }
         FX_FREE_STR(&v_0);
      }
      else {
         _fx_free_LS(&result_0); FX_COPY_PTR(res_2, &result_0); FX_BREAK(_fx_catch_1);  _fx_catch_1: ;
      }
      FX_CHECK_EXN(_fx_catch_2);

   _fx_catch_2: ;
      if (res_2) {
         _fx_free_LS(&res_2);
      }
      FX_FREE_FP(&f_2);
      if (t_2) {
         _fx_free_Nt11Set__tree_t1R9Ast__id_t(&t_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(result_0, fx_result);

_fx_cleanup: ;
   if (result_0) {
      _fx_free_LS(&result_0);
   }
   if (t_1) {
      _fx_free_Nt11Set__tree_t1R9Ast__id_t(&t_1);
   }
   FX_FREE_FP(&f_1);
   if (res_1) {
      _fx_free_LS(&res_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM3mapLS2Rt6Set__t1R9Ast__id_tFPS1R9Ast__id_t(
   struct _fx_Rt6Set__t1R9Ast__id_t* s_0,
   struct _fx_FPS1R9Ast__id_t* f_0,
   struct _fx_LS_data_t** fx_result,
   void* fx_fv)
{
   _fx_Nt11Set__tree_t1R9Ast__id_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(s_0->root, &v_0);
   FX_CALL(_fx_M11K_normalizeFM12update_list_LS3Nt11Set__tree_t1R9Ast__id_tFPS1R9Ast__id_tLS(v_0, f_0, 0, fx_result, 0),
      _fx_cleanup);

_fx_cleanup: ;
   if (v_0) {
      _fx_free_Nt11Set__tree_t1R9Ast__id_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__typ_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_rLR9Ast__id_t id_stack_ref_0 = 0;
   int fx_status = 0;
   FX_CALL(_fx_make_rLR9Ast__id_t(0, &id_stack_ref_0), _fx_cleanup);
   FX_CALL(
      _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(t_0, id_stack_ref_0, loc_0,
         fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   if (id_stack_ref_0) {
      _fx_free_rLR9Ast__id_t(&id_stack_ref_0);
   }
   return fx_status;
}

static int _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(
   struct _fx_N10Ast__typ_t_data_t* t_0,
   struct _fx_rLR9Ast__id_t_data_t* id_stack_ref_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N14K_form__ktyp_t result_0 = 0;
   _fx_N10Ast__typ_t t_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_LR9Ast__id_t* id_stack_0 = &id_stack_ref_0->data;
   FX_COPY_PTR(t_0, &t_1);
   for (;;) {
      _fx_N10Ast__typ_t t_2 = 0;
      _fx_N10Ast__typ_t t_3 = 0;
      _fx_Nt6option1N10Ast__typ_t v_0 = 0;
      _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_1 = {0};
      FX_COPY_PTR(t_1, &t_2);
      FX_CALL(_fx_M3AstFM9deref_typN10Ast__typ_t1N10Ast__typ_t(t_2, &t_3, 0), _fx_catch_36);
      int tag_0 = FX_REC_VARIANT_TAG(t_3);
      if (tag_0 == 1) {
         FX_COPY_PTR(t_3->u.TypVar->data, &v_0);
         if ((v_0 != 0) + 1 == 2) {
            _fx_N10Ast__typ_t* t_4 = &v_0->u.Some; _fx_free_N10Ast__typ_t(&t_1); FX_COPY_PTR(*t_4, &t_1); goto _fx_endmatch_2;
         }
      }
      if (tag_0 == 1) {
         fx_exn_t v_2 = {0};
         fx_str_t slit_0 = FX_MAKE_STR("undefined type; use explicit type annotation");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_0, &v_2, 0), _fx_catch_0);
         FX_THROW(&v_2, false, _fx_catch_0);

      _fx_catch_0: ;
         fx_free_exn(&v_2);
         goto _fx_endmatch_2;
      }
      if (tag_0 == 5) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g20K_normalize__KTypInt, &result_0);
         FX_BREAK(_fx_catch_1);

      _fx_catch_1: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 8) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g21K_normalize__KTypLong, &result_0);
         FX_BREAK(_fx_catch_2);

      _fx_catch_2: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 6) {
         _fx_N14K_form__ktyp_t result_1 = 0;
         FX_CALL(_fx_M6K_formFM8KTypSIntN14K_form__ktyp_t1i(t_3->u.TypSInt, &result_1), _fx_catch_3);
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(result_1, &result_0);
         FX_BREAK(_fx_catch_3);

      _fx_catch_3: ;
         if (result_1) {
            _fx_free_N14K_form__ktyp_t(&result_1);
         }
         goto _fx_endmatch_2;
      }
      if (tag_0 == 7) {
         _fx_N14K_form__ktyp_t result_2 = 0;
         FX_CALL(_fx_M6K_formFM8KTypUIntN14K_form__ktyp_t1i(t_3->u.TypUInt, &result_2), _fx_catch_4);
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(result_2, &result_0);
         FX_BREAK(_fx_catch_4);

      _fx_catch_4: ;
         if (result_2) {
            _fx_free_N14K_form__ktyp_t(&result_2);
         }
         goto _fx_endmatch_2;
      }
      if (tag_0 == 9) {
         _fx_N14K_form__ktyp_t result_3 = 0;
         FX_CALL(_fx_M6K_formFM9KTypFloatN14K_form__ktyp_t1i(t_3->u.TypFloat, &result_3), _fx_catch_5);
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(result_3, &result_0);
         FX_BREAK(_fx_catch_5);

      _fx_catch_5: ;
         if (result_3) {
            _fx_free_N14K_form__ktyp_t(&result_3);
         }
         goto _fx_endmatch_2;
      }
      if (tag_0 == 10) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g23K_normalize__KTypString, &result_0);
         FX_BREAK(_fx_catch_6);

      _fx_catch_6: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 11) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g21K_normalize__KTypChar, &result_0);
         FX_BREAK(_fx_catch_7);

      _fx_catch_7: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 12) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g21K_normalize__KTypBool, &result_0);
         FX_BREAK(_fx_catch_8);

      _fx_catch_8: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 13) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g21K_normalize__KTypVoid, &result_0);
         FX_BREAK(_fx_catch_9);

      _fx_catch_9: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 21) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g20K_normalize__KTypExn, &result_0);
         FX_BREAK(_fx_catch_10);

      _fx_catch_10: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 22) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g20K_normalize__KTypErr, &result_0);
         FX_BREAK(_fx_catch_11);

      _fx_catch_11: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 23) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g25K_normalize__KTypCPointer, &result_0);
         FX_BREAK(_fx_catch_12);

      _fx_catch_12: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 25) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g21K_normalize__KTypVoid, &result_0);
         FX_BREAK(_fx_catch_13);

      _fx_catch_13: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 26) {
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(_fx_g23K_normalize__KTypModule, &result_0);
         FX_BREAK(_fx_catch_14);

      _fx_catch_14: ;
         goto _fx_endmatch_2;
      }
      if (tag_0 == 15) {
         _fx_N14K_form__ktyp_t v_3 = 0;
         _fx_N14K_form__ktyp_t result_4 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(t_3->u.TypList,
               id_stack_ref_0, loc_0, &v_3, 0), _fx_catch_15);
         FX_CALL(_fx_M6K_formFM8KTypListN14K_form__ktyp_t1N14K_form__ktyp_t(v_3, &result_4), _fx_catch_15);
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(result_4, &result_0);
         FX_BREAK(_fx_catch_15);

      _fx_catch_15: ;
         if (result_4) {
            _fx_free_N14K_form__ktyp_t(&result_4);
         }
         if (v_3) {
            _fx_free_N14K_form__ktyp_t(&v_3);
         }
         goto _fx_endmatch_2;
      }
      if (tag_0 == 17) {
         _fx_LN14K_form__ktyp_t v_4 = 0;
         _fx_LN10Ast__typ_t tl_0 = 0;
         _fx_N14K_form__ktyp_t result_5 = 0;
         _fx_LN14K_form__ktyp_t lstend_0 = 0;
         FX_COPY_PTR(t_3->u.TypTuple, &tl_0);
         _fx_LN10Ast__typ_t lst_0 = tl_0;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_N14K_form__ktyp_t res_0 = 0;
            _fx_N10Ast__typ_t t_5 = lst_0->hd;
            FX_CALL(
               _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(t_5, id_stack_ref_0,
                  loc_0, &res_0, 0), _fx_catch_16);
            _fx_LN14K_form__ktyp_t node_0 = 0;
            FX_CALL(_fx_cons_LN14K_form__ktyp_t(res_0, 0, false, &node_0), _fx_catch_16);
            FX_LIST_APPEND(v_4, lstend_0, node_0);

         _fx_catch_16: ;
            if (res_0) {
               _fx_free_N14K_form__ktyp_t(&res_0);
            }
            FX_CHECK_EXN(_fx_catch_17);
         }
         FX_CALL(_fx_M6K_formFM9KTypTupleN14K_form__ktyp_t1LN14K_form__ktyp_t(v_4, &result_5), _fx_catch_17);
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(result_5, &result_0);
         FX_BREAK(_fx_catch_17);

      _fx_catch_17: ;
         if (result_5) {
            _fx_free_N14K_form__ktyp_t(&result_5);
         }
         if (tl_0) {
            _fx_free_LN10Ast__typ_t(&tl_0);
         }
         if (v_4) {
            _fx_free_LN14K_form__ktyp_t(&v_4);
         }
         goto _fx_endmatch_2;
      }
      if (tag_0 == 2) {
         fx_exn_t v_5 = {0};
         fx_str_t slit_1 = FX_MAKE_STR("variable tuple type cannot be inferenced; please, use explicit type annotation");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_1, &v_5, 0), _fx_catch_18);
         FX_THROW(&v_5, false, _fx_catch_18);

      _fx_catch_18: ;
         fx_free_exn(&v_5);
         goto _fx_endmatch_2;
      }
      if (tag_0 == 18) {
         _fx_N14K_form__ktyp_t v_6 = 0;
         _fx_N14K_form__ktyp_t result_6 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(t_3->u.TypRef,
               id_stack_ref_0, loc_0, &v_6, 0), _fx_catch_19);
         FX_CALL(_fx_M6K_formFM7KTypRefN14K_form__ktyp_t1N14K_form__ktyp_t(v_6, &result_6), _fx_catch_19);
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(result_6, &result_0);
         FX_BREAK(_fx_catch_19);

      _fx_catch_19: ;
         if (result_6) {
            _fx_free_N14K_form__ktyp_t(&result_6);
         }
         if (v_6) {
            _fx_free_N14K_form__ktyp_t(&v_6);
         }
         goto _fx_endmatch_2;
      }
      if (tag_0 == 19) {
         _fx_N14K_form__ktyp_t v_7 = 0;
         _fx_N14K_form__ktyp_t result_7 = 0;
         _fx_T2iN10Ast__typ_t* vcase_0 = &t_3->u.TypArray;
         FX_CALL(
            _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(vcase_0->t1, id_stack_ref_0,
               loc_0, &v_7, 0), _fx_catch_20);
         FX_CALL(_fx_M6K_formFM9KTypArrayN14K_form__ktyp_t2iN14K_form__ktyp_t(vcase_0->t0, v_7, &result_7), _fx_catch_20);
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(result_7, &result_0);
         FX_BREAK(_fx_catch_20);

      _fx_catch_20: ;
         if (result_7) {
            _fx_free_N14K_form__ktyp_t(&result_7);
         }
         if (v_7) {
            _fx_free_N14K_form__ktyp_t(&v_7);
         }
         goto _fx_endmatch_2;
      }
      if (tag_0 == 16) {
         _fx_N14K_form__ktyp_t v_8 = 0;
         _fx_N14K_form__ktyp_t result_8 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(t_3->u.TypVector,
               id_stack_ref_0, loc_0, &v_8, 0), _fx_catch_21);
         FX_CALL(_fx_M6K_formFM10KTypVectorN14K_form__ktyp_t1N14K_form__ktyp_t(v_8, &result_8), _fx_catch_21);
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(result_8, &result_0);
         FX_BREAK(_fx_catch_21);

      _fx_catch_21: ;
         if (result_8) {
            _fx_free_N14K_form__ktyp_t(&result_8);
         }
         if (v_8) {
            _fx_free_N14K_form__ktyp_t(&v_8);
         }
         goto _fx_endmatch_2;
      }
      if (tag_0 == 3) {
         fx_exn_t v_9 = {0};
         fx_str_t slit_2 = FX_MAKE_STR("variable array type cannot be inferenced; please, use explicit type annotation");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_2, &v_9, 0), _fx_catch_22);
         FX_THROW(&v_9, false, _fx_catch_22);

      _fx_catch_22: ;
         fx_free_exn(&v_9);
         goto _fx_endmatch_2;
      }
      if (tag_0 == 4) {
         fx_exn_t v_10 = {0};
         fx_str_t slit_3 = FX_MAKE_STR("variable record type cannot be inferenced; please, use explicit type annotation");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_3, &v_10, 0), _fx_catch_23);
         FX_THROW(&v_10, false, _fx_catch_23);

      _fx_catch_23: ;
         fx_free_exn(&v_10);
         goto _fx_endmatch_2;
      }
      if (tag_0 == 14) {
         _fx_LN14K_form__ktyp_t v_11 = 0;
         _fx_LN10Ast__typ_t args_0 = 0;
         _fx_N14K_form__ktyp_t v_12 = 0;
         _fx_N14K_form__ktyp_t result_9 = 0;
         _fx_T2LN10Ast__typ_tN10Ast__typ_t* vcase_1 = &t_3->u.TypFun;
         _fx_LN14K_form__ktyp_t lstend_1 = 0;
         FX_COPY_PTR(vcase_1->t0, &args_0);
         _fx_LN10Ast__typ_t lst_1 = args_0;
         for (; lst_1; lst_1 = lst_1->tl) {
            _fx_N14K_form__ktyp_t res_1 = 0;
            _fx_N10Ast__typ_t t_6 = lst_1->hd;
            FX_CALL(
               _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(t_6, id_stack_ref_0,
                  loc_0, &res_1, 0), _fx_catch_24);
            _fx_LN14K_form__ktyp_t node_1 = 0;
            FX_CALL(_fx_cons_LN14K_form__ktyp_t(res_1, 0, false, &node_1), _fx_catch_24);
            FX_LIST_APPEND(v_11, lstend_1, node_1);

         _fx_catch_24: ;
            if (res_1) {
               _fx_free_N14K_form__ktyp_t(&res_1);
            }
            FX_CHECK_EXN(_fx_catch_25);
         }
         FX_CALL(
            _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(vcase_1->t1, id_stack_ref_0,
               loc_0, &v_12, 0), _fx_catch_25);
         FX_CALL(_fx_M6K_formFM7KTypFunN14K_form__ktyp_t2LN14K_form__ktyp_tN14K_form__ktyp_t(v_11, v_12, &result_9),
            _fx_catch_25);
         _fx_free_N14K_form__ktyp_t(&result_0);
         FX_COPY_PTR(result_9, &result_0);
         FX_BREAK(_fx_catch_25);

      _fx_catch_25: ;
         if (result_9) {
            _fx_free_N14K_form__ktyp_t(&result_9);
         }
         if (v_12) {
            _fx_free_N14K_form__ktyp_t(&v_12);
         }
         if (args_0) {
            _fx_free_LN10Ast__typ_t(&args_0);
         }
         if (v_11) {
            _fx_free_LN14K_form__ktyp_t(&v_11);
         }
         goto _fx_endmatch_2;
      }
      if (tag_0 == 20) {
         _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&t_3->u.TypRecord->data, &v_1);
         if (v_1.t1 == true) {
            _fx_LT2R9Ast__id_tN14K_form__ktyp_t v_13 = 0;
            _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_0 = 0;
            _fx_N14K_form__ktyp_t result_10 = 0;
            _fx_LT2R9Ast__id_tN14K_form__ktyp_t lstend_2 = 0;
            FX_COPY_PTR(v_1.t0, &relems_0);
            _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_2 = relems_0;
            for (; lst_2; lst_2 = lst_2->tl) {
               _fx_N10Ast__typ_t ti_0 = 0;
               _fx_N14K_form__ktyp_t v_14 = 0;
               _fx_T2R9Ast__id_tN14K_form__ktyp_t tup_0 = {0};
               _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* __pat___0 = &lst_2->hd;
               _fx_R9Ast__id_t ni_0 = __pat___0->t1;
               FX_COPY_PTR(__pat___0->t2, &ti_0);
               FX_CALL(
                  _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(ti_0, id_stack_ref_0,
                     loc_0, &v_14, 0), _fx_catch_26);
               _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(&ni_0, v_14, &tup_0);
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t node_2 = 0;
               FX_CALL(_fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(&tup_0, 0, false, &node_2), _fx_catch_26);
               FX_LIST_APPEND(v_13, lstend_2, node_2);

            _fx_catch_26: ;
               _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&tup_0);
               if (v_14) {
                  _fx_free_N14K_form__ktyp_t(&v_14);
               }
               if (ti_0) {
                  _fx_free_N10Ast__typ_t(&ti_0);
               }
               FX_CHECK_EXN(_fx_catch_27);
            }
            FX_CALL(
               _fx_M6K_formFM10KTypRecordN14K_form__ktyp_t2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(&_fx_g9Ast__noid, v_13,
                  &result_10), _fx_catch_27);
            _fx_free_N14K_form__ktyp_t(&result_0);
            FX_COPY_PTR(result_10, &result_0);
            FX_BREAK(_fx_catch_27);

         _fx_catch_27: ;
            if (result_10) {
               _fx_free_N14K_form__ktyp_t(&result_10);
            }
            if (relems_0) {
               _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_0);
            }
            if (v_13) {
               _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&v_13);
            }
            goto _fx_endmatch_2;
         }
      }
      if (tag_0 == 20) {
         fx_exn_t v_15 = {0};
         fx_str_t slit_4 = FX_MAKE_STR("the record type cannot be inferenced; use explicit type annotation");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_4, &v_15, 0), _fx_catch_28);
         FX_THROW(&v_15, false, _fx_catch_28);

      _fx_catch_28: ;
         fx_free_exn(&v_15);
         goto _fx_endmatch_2;
      }
      if (tag_0 == 24) {
         _fx_Nt6option1N10Ast__typ_t t_opt_0 = 0;
         FX_CALL(
            _fx_M13Ast_typecheckFM17find_typ_instanceNt6option1N10Ast__typ_t2N10Ast__typ_tR10Ast__loc_t(t_3, loc_0, &t_opt_0,
               0), _fx_catch_35);
         if ((t_opt_0 != 0) + 1 == 2) {
            _fx_N10Ast__typ_t v_16 = t_opt_0->u.Some;
            if (FX_REC_VARIANT_TAG(v_16) == 24) {
               _fx_T2LN10Ast__typ_tR9Ast__id_t* vcase_2 = &v_16->u.TypApp;
               if (vcase_2->t0 == 0) {
                  _fx_N14Ast__id_info_t v_17 = {0};
                  _fx_R17Ast__defvariant_t v_18 = {0};
                  _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_19 = {0};
                  _fx_R9Ast__id_t* n_0 = &vcase_2->t1;
                  FX_CALL(_fx_M3AstFM7id_infoN14Ast__id_info_t2RM4id_tRM5loc_t(n_0, loc_0, &v_17, 0), _fx_catch_33);
                  if (v_17.tag == 6) {
                     _fx_copy_R17Ast__defvariant_t(&v_17.u.IdVariant->data, &v_18);
                     _fx_LT2R9Ast__id_tN10Ast__typ_t v_20 = v_18.dvar_cases;
                     if (v_20 != 0) {
                        if (v_20->tl == 0) {
                           _fx_N10Ast__typ_t v_21 = v_20->hd.t1;
                           if (FX_REC_VARIANT_TAG(v_21) == 20) {
                              _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_21->u.TypRecord->data,
                                 &v_19);
                              if (v_19.t1 == true) {
                                 if (v_18.dvar_flags.var_flag_record) {
                                    _fx_LR9Ast__id_t id_stack_1 = 0;
                                    fx_str_t v_22 = {0};
                                    fx_str_t v_23 = {0};
                                    fx_exn_t v_24 = {0};
                                    _fx_LR9Ast__id_t v_25 = 0;
                                    _fx_LT2R9Ast__id_tN14K_form__ktyp_t v_26 = 0;
                                    _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_1 = 0;
                                    _fx_N14K_form__ktyp_t new_t_0 = 0;
                                    _fx_LR9Ast__id_t v_27 = 0;
                                    bool __fold_result___0 = false;
                                    FX_COPY_PTR(*id_stack_0, &id_stack_1);
                                    _fx_LR9Ast__id_t lst_3 = id_stack_1;
                                    for (; lst_3; lst_3 = lst_3->tl) {
                                       _fx_R9Ast__id_t* b_0 = &lst_3->hd;
                                       bool __fold_result___1 = true;
                                       bool t_7;
                                       if (n_0->m == b_0->m) {
                                          t_7 = __fold_result___1;
                                       }
                                       else {
                                          t_7 = false;
                                       }
                                       __fold_result___1 = t_7;
                                       bool t_8;
                                       if (n_0->i == b_0->i) {
                                          t_8 = __fold_result___1;
                                       }
                                       else {
                                          t_8 = false;
                                       }
                                       __fold_result___1 = t_8;
                                       bool t_9;
                                       if (n_0->j == b_0->j) {
                                          t_9 = __fold_result___1;
                                       }
                                       else {
                                          t_9 = false;
                                       }
                                       __fold_result___1 = t_9;
                                       if (__fold_result___1) {
                                          __fold_result___0 = true; FX_BREAK(_fx_catch_29);
                                       }

                                    _fx_catch_29: ;
                                       FX_CHECK_BREAK();
                                       FX_CHECK_EXN(_fx_catch_31);
                                    }
                                    if (__fold_result___0) {
                                       FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_22, 0), _fx_catch_31);
                                       fx_str_t slit_5 = FX_MAKE_STR("the record \'");
                                       fx_str_t slit_6 = FX_MAKE_STR("\' directly or indirectly references itself");
                                       {
                                          const fx_str_t strs_0[] = { slit_5, v_22, slit_6 };
                                          FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_23), _fx_catch_31);
                                       }
                                       FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_23, &v_24, 0), _fx_catch_31);
                                       FX_THROW(&v_24, false, _fx_catch_31);
                                    }
                                    else {
                                       FX_CALL(_fx_cons_LR9Ast__id_t(n_0, *id_stack_0, true, &v_25), _fx_catch_31);
                                       FX_FREE_LIST_SIMPLE(id_stack_0);
                                       FX_COPY_PTR(v_25, id_stack_0);
                                       _fx_LT2R9Ast__id_tN14K_form__ktyp_t lstend_3 = 0;
                                       FX_COPY_PTR(v_19.t0, &relems_1);
                                       _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_4 = relems_1;
                                       for (; lst_4; lst_4 = lst_4->tl) {
                                          _fx_N10Ast__typ_t ti_1 = 0;
                                          _fx_N14K_form__ktyp_t v_28 = 0;
                                          _fx_T2R9Ast__id_tN14K_form__ktyp_t tup_1 = {0};
                                          _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* __pat___1 =
                                             &lst_4->hd;
                                          _fx_R9Ast__id_t ni_1 = __pat___1->t1;
                                          FX_COPY_PTR(__pat___1->t2, &ti_1);
                                          FX_CALL(
                                             _fx_M11K_normalizeFM9typ2ktyp_N14K_form__ktyp_t3N10Ast__typ_trLR9Ast__id_tR10Ast__loc_t(
                                                ti_1, id_stack_ref_0, loc_0, &v_28, 0), _fx_catch_30);
                                          _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(&ni_1, v_28, &tup_1);
                                          _fx_LT2R9Ast__id_tN14K_form__ktyp_t node_3 = 0;
                                          FX_CALL(_fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(&tup_1, 0, false, &node_3),
                                             _fx_catch_30);
                                          FX_LIST_APPEND(v_26, lstend_3, node_3);

                                       _fx_catch_30: ;
                                          _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&tup_1);
                                          if (v_28) {
                                             _fx_free_N14K_form__ktyp_t(&v_28);
                                          }
                                          if (ti_1) {
                                             _fx_free_N10Ast__typ_t(&ti_1);
                                          }
                                          FX_CHECK_EXN(_fx_catch_31);
                                       }
                                       FX_CALL(
                                          _fx_M6K_formFM10KTypRecordN14K_form__ktyp_t2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(
                                             n_0, v_26, &new_t_0), _fx_catch_31);
                                       if (*id_stack_0 != 0) {
                                          FX_COPY_PTR((*id_stack_0)->tl, &v_27);
                                       }
                                       else {
                                          FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_31);
                                       }
                                       FX_CHECK_EXN(_fx_catch_31);
                                       FX_FREE_LIST_SIMPLE(id_stack_0);
                                       FX_COPY_PTR(v_27, id_stack_0);
                                       _fx_free_N14K_form__ktyp_t(&result_0);
                                       FX_COPY_PTR(new_t_0, &result_0);
                                       FX_BREAK(_fx_catch_31);
                                    }

                                 _fx_catch_31: ;
                                    FX_FREE_LIST_SIMPLE(&v_27);
                                    if (new_t_0) {
                                       _fx_free_N14K_form__ktyp_t(&new_t_0);
                                    }
                                    if (relems_1) {
                                       _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_1);
                                    }
                                    if (v_26) {
                                       _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&v_26);
                                    }
                                    FX_FREE_LIST_SIMPLE(&v_25);
                                    fx_free_exn(&v_24);
                                    FX_FREE_STR(&v_23);
                                    FX_FREE_STR(&v_22);
                                    FX_FREE_LIST_SIMPLE(&id_stack_1);
                                    goto _fx_endmatch_0;
                                 }
                              }
                           }
                        }
                     }
                  }
                  _fx_N14K_form__ktyp_t result_11 = 0;
                  FX_CALL(_fx_M6K_formFM8KTypNameN14K_form__ktyp_t1R9Ast__id_t(n_0, &result_11), _fx_catch_32);
                  _fx_free_N14K_form__ktyp_t(&result_0);
                  FX_COPY_PTR(result_11, &result_0);
                  FX_BREAK(_fx_catch_32);

               _fx_catch_32: ;
                  if (result_11) {
                     _fx_free_N14K_form__ktyp_t(&result_11);
                  }

               _fx_endmatch_0: ;
                  FX_CHECK_EXN(_fx_catch_33);

               _fx_catch_33: ;
                  _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_19);
                  _fx_free_R17Ast__defvariant_t(&v_18);
                  _fx_free_N14Ast__id_info_t(&v_17);
                  goto _fx_endmatch_1;
               }
            }
         }
         fx_str_t v_29 = {0};
         fx_str_t v_30 = {0};
         fx_exn_t v_31 = {0};
         FX_CALL(_fx_M3AstFM7typ2strS1N10Ast__typ_t(t_3, &v_29, 0), _fx_catch_34);
         fx_str_t slit_7 = FX_MAKE_STR("the proper instance of the template type \'");
         fx_str_t slit_8 = FX_MAKE_STR("\' is not found");
         {
            const fx_str_t strs_1[] = { slit_7, v_29, slit_8 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_30), _fx_catch_34);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_30, &v_31, 0), _fx_catch_34);
         FX_THROW(&v_31, false, _fx_catch_34);

      _fx_catch_34: ;
         fx_free_exn(&v_31);
         FX_FREE_STR(&v_30);
         FX_FREE_STR(&v_29);

      _fx_endmatch_1: ;
         FX_CHECK_EXN(_fx_catch_35);

      _fx_catch_35: ;
         if (t_opt_0) {
            _fx_free_Nt6option1N10Ast__typ_t(&t_opt_0);
         }
         goto _fx_endmatch_2;
      }
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_36);

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_36);

   _fx_catch_36: ;
      _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_1);
      if (v_0) {
         _fx_free_Nt6option1N10Ast__typ_t(&v_0);
      }
      if (t_3) {
         _fx_free_N10Ast__typ_t(&t_3);
      }
      if (t_2) {
         _fx_free_N10Ast__typ_t(&t_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(result_0, fx_result);

_fx_cleanup: ;
   if (result_0) {
      _fx_free_N14K_form__ktyp_t(&result_0);
   }
   if (t_1) {
      _fx_free_N10Ast__typ_t(&t_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM8lit2klitN14K_form__klit_t3N10Ast__lit_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N10Ast__lit_t* l_0,
   struct _fx_N14K_form__ktyp_t_data_t* ktyp_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__klit_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = l_0->tag;
   if (tag_0 == 1) {
      _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(l_0->u.LitInt, fx_result);
   }
   else if (tag_0 == 2) {
      _fx_T2il* vcase_0 = &l_0->u.LitSInt; _fx_M6K_formFM8KLitSIntN14K_form__klit_t2il(vcase_0->t0, vcase_0->t1, fx_result);
   }
   else if (tag_0 == 3) {
      _fx_T2iq* vcase_1 = &l_0->u.LitUInt; _fx_M6K_formFM8KLitUIntN14K_form__klit_t2iq(vcase_1->t0, vcase_1->t1, fx_result);
   }
   else if (tag_0 == 4) {
      _fx_T2id* vcase_2 = &l_0->u.LitFloat; _fx_M6K_formFM9KLitFloatN14K_form__klit_t2id(vcase_2->t0, vcase_2->t1, fx_result);
   }
   else if (tag_0 == 5) {
      _fx_M6K_formFM10KLitStringN14K_form__klit_t1S(&l_0->u.LitString, fx_result);
   }
   else if (tag_0 == 6) {
      _fx_M6K_formFM8KLitCharN14K_form__klit_t1C(l_0->u.LitChar, fx_result);
   }
   else if (tag_0 == 7) {
      _fx_M6K_formFM8KLitBoolN14K_form__klit_t1B(l_0->u.LitBool, fx_result);
   }
   else if (tag_0 == 8) {
      int tag_1 = FX_REC_VARIANT_TAG(ktyp_0);
      bool res_0;
      if (tag_1 == 19) {
         res_0 = true;
      }
      else if (tag_1 == 18) {
         res_0 = true;
      }
      else if (tag_1 == 17) {
         res_0 = true;
      }
      else {
         res_0 = false;
      }
      FX_CHECK_EXN(_fx_catch_1);
      if (res_0) {
         _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(ktyp_0, fx_result); goto _fx_endmatch_0;
      }
      fx_exn_t v_0 = {0};
      fx_str_t slit_0 = FX_MAKE_STR("[] is misused. It can only denote an empty collection (list, vector or array)");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_0, &v_0, 0), _fx_catch_0);
      FX_THROW(&v_0, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_0);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_1);

   _fx_catch_1: ;
   }
   else if (tag_0 == 9) {
      _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(_fx_g25K_normalize__KTypCPointer, fx_result);
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM8is_rangeB1N10Ast__exp_t(struct _fx_N10Ast__exp_t_data_t* e_0, bool* fx_result, void* fx_fv)
{
   int fx_status = 0;
   if (FX_REC_VARIANT_TAG(e_0) == 5) {
      *fx_result = true;
   }
   else {
      *fx_result = false;
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM10find_relemi4R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* rn_0,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* relems_0,
   struct _fx_R9Ast__id_t* elem_id_0,
   struct _fx_R10Ast__loc_t* loc_0,
   int_* fx_result,
   void* fx_fv)
{
   fx_str_t v_0 = {0};
   fx_str_t v_1 = {0};
   fx_str_t v_2 = {0};
   fx_exn_t v_3 = {0};
   int fx_status = 0;
   _fx_Ta2i __fold_result___0 = { -1, 0 };
   _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_0 = relems_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___0 = &lst_0->hd;
      _fx_R9Ast__id_t ni_0 = __pat___0->t0;
      _fx_Ta2i v_4 = __fold_result___0;
      int_ j_0 = v_4.t1;
      bool res_0;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(elem_id_0, &ni_0, &res_0, 0), _fx_catch_0);
      _fx_Ta2i v_5;
      if (res_0) {
         _fx_Ta2i tup_0 = { j_0, j_0 + 1 }; v_5 = tup_0;
      }
      else {
         _fx_Ta2i tup_1 = { v_4.t0, j_0 + 1 }; v_5 = tup_1;
      }
      __fold_result___0 = v_5;

   _fx_catch_0: ;
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_Ta2i v_6 = __fold_result___0;
   int_ i_0 = v_6.t0;
   if (i_0 >= 0) {
      *fx_result = i_0;
   }
   else {
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(elem_id_0, &v_0, 0), _fx_cleanup);
      FX_CALL(_fx_M3AstFM2ppS1RM4id_t(rn_0, &v_1, 0), _fx_cleanup);
      fx_str_t slit_0 = FX_MAKE_STR("there is no record field \'");
      fx_str_t slit_1 = FX_MAKE_STR("\' in the record \'");
      fx_str_t slit_2 = FX_MAKE_STR("\'");
      {
         const fx_str_t strs_0[] = { slit_0, v_0, slit_1, v_1, slit_2 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 5, &v_2), _fx_cleanup);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_2, &v_3, 0), _fx_cleanup);
      FX_THROW(&v_3, false, _fx_cleanup);
   }

_fx_cleanup: ;
   FX_FREE_STR(&v_0);
   FX_FREE_STR(&v_1);
   FX_FREE_STR(&v_2);
   fx_free_exn(&v_3);
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   bool tref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N14K_form__kexp_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_0 = {0};
   _fx_N10Ast__typ_t etyp_0 = 0;
   _fx_N14K_form__ktyp_t ktyp_0 = 0;
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t kctx_0 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int_ km_idx_0;
   FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &km_idx_0, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM11get_exp_ctxT2N10Ast__typ_tRM5loc_t1N10Ast__exp_t(e_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &etyp_0);
   _fx_R10Ast__loc_t eloc_0 = v_0.t1;
   FX_CALL(_fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(etyp_0, &eloc_0, &ktyp_0, 0), _fx_cleanup);
   _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ktyp_0, &eloc_0, &kctx_0);
   int tag_0 = FX_REC_VARIANT_TAG(e_0);
   if (tag_0 == 1) {
      _fx_N14K_form__kexp_t v_1 = 0;
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&e_0->u.ExpNop, &v_1), _fx_catch_0);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_1, code_0, fx_result);

   _fx_catch_0: ;
      if (v_1) {
         _fx_free_N14K_form__kexp_t(&v_1);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 2) {
      _fx_N14K_form__kexp_t v_2 = 0;
      FX_CALL(_fx_M6K_formFM9KExpBreakN14K_form__kexp_t1R10Ast__loc_t(&e_0->u.ExpBreak.t1, &v_2), _fx_catch_1);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_2, code_0, fx_result);

   _fx_catch_1: ;
      if (v_2) {
         _fx_free_N14K_form__kexp_t(&v_2);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 3) {
      _fx_N14K_form__kexp_t v_3 = 0;
      FX_CALL(_fx_M6K_formFM12KExpContinueN14K_form__kexp_t1R10Ast__loc_t(&e_0->u.ExpContinue, &v_3), _fx_catch_2);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_3, code_0, fx_result);

   _fx_catch_2: ;
      if (v_3) {
         _fx_free_N14K_form__kexp_t(&v_3);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 4) {
      _fx_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t v_4 = {0};
      _fx_Nt6option1N14K_form__atom_t a_opt_0 = {0};
      _fx_LN14K_form__kexp_t code_1 = 0;
      _fx_N14K_form__kexp_t v_5 = 0;
      _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* vcase_0 = &e_0->u.ExpReturn;
      _fx_Nt6option1N10Ast__exp_t e_opt_0 = vcase_0->t0;
      if ((e_opt_0 != 0) + 1 == 2) {
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_6 = {0};
         _fx_N14K_form__atom_t a_0 = {0};
         _fx_LN14K_form__kexp_t code_2 = 0;
         _fx_Nt6option1N14K_form__atom_t v_7 = {0};
         FX_CALL(
            _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               e_opt_0->u.Some, code_0, false, sc_0, &v_6, 0), _fx_catch_3);
         _fx_copy_N14K_form__atom_t(&v_6.t0, &a_0);
         FX_COPY_PTR(v_6.t1, &code_2);
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__atom_t1N14K_form__atom_t(&a_0, &v_7);
         _fx_make_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t(&v_7, code_2, &v_4);

      _fx_catch_3: ;
         _fx_free_Nt6option1N14K_form__atom_t(&v_7);
         if (code_2) {
            _fx_free_LN14K_form__kexp_t(&code_2);
         }
         _fx_free_N14K_form__atom_t(&a_0);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_6);
      }
      else {
         _fx_make_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t(&_fx_g19K_normalize__None5_, code_0, &v_4);
      }
      FX_CHECK_EXN(_fx_catch_4);
      _fx_copy_Nt6option1N14K_form__atom_t(&v_4.t0, &a_opt_0);
      FX_COPY_PTR(v_4.t1, &code_1);
      FX_CALL(
         _fx_M6K_formFM10KExpReturnN14K_form__kexp_t2Nt6option1N14K_form__atom_tR10Ast__loc_t(&a_opt_0, &vcase_0->t1, &v_5),
         _fx_catch_4);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_5, code_1, fx_result);

   _fx_catch_4: ;
      if (v_5) {
         _fx_free_N14K_form__kexp_t(&v_5);
      }
      if (code_1) {
         _fx_free_LN14K_form__kexp_t(&code_1);
      }
      _fx_free_Nt6option1N14K_form__atom_t(&a_opt_0);
      _fx_free_T2Nt6option1N14K_form__atom_tLN14K_form__kexp_t(&v_4);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 5) {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_8 = {0};
      _fx_N14K_form__atom_t a1_0 = {0};
      _fx_LN14K_form__kexp_t code_3 = 0;
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_9 = {0};
      _fx_N14K_form__atom_t a2_0 = {0};
      _fx_LN14K_form__kexp_t code_4 = 0;
      _fx_N14K_form__klit_t v_10 = {0};
      _fx_N14K_form__atom_t v_11 = {0};
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_12 = {0};
      _fx_N14K_form__atom_t a3_0 = {0};
      _fx_LN14K_form__kexp_t code_5 = 0;
      _fx_LN14K_form__atom_t v_13 = 0;
      _fx_N14K_form__kexp_t v_14 = 0;
      _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_1 =
         &e_0->u.ExpRange;
      FX_CALL(
         _fx_M11K_normalizeFM13process_rpartT2N14K_form__atom_tLN14K_form__kexp_t4Nt6option1N10Ast__exp_tLN14K_form__kexp_tN14K_form__atom_tLN12Ast__scope_t(
            vcase_1->t0, code_0, &_fx_g17K_form___ALitVoid, sc_0, &v_8, 0), _fx_catch_5);
      _fx_copy_N14K_form__atom_t(&v_8.t0, &a1_0);
      FX_COPY_PTR(v_8.t1, &code_3);
      FX_CALL(
         _fx_M11K_normalizeFM13process_rpartT2N14K_form__atom_tLN14K_form__kexp_t4Nt6option1N10Ast__exp_tLN14K_form__kexp_tN14K_form__atom_tLN12Ast__scope_t(
            vcase_1->t1, code_3, &_fx_g17K_form___ALitVoid, sc_0, &v_9, 0), _fx_catch_5);
      _fx_copy_N14K_form__atom_t(&v_9.t0, &a2_0);
      FX_COPY_PTR(v_9.t1, &code_4);
      _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(1LL, &v_10);
      _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_10, &v_11);
      FX_CALL(
         _fx_M11K_normalizeFM13process_rpartT2N14K_form__atom_tLN14K_form__kexp_t4Nt6option1N10Ast__exp_tLN14K_form__kexp_tN14K_form__atom_tLN12Ast__scope_t(
            vcase_1->t2, code_4, &v_11, sc_0, &v_12, 0), _fx_catch_5);
      _fx_copy_N14K_form__atom_t(&v_12.t0, &a3_0);
      FX_COPY_PTR(v_12.t1, &code_5);
      FX_CALL(_fx_cons_LN14K_form__atom_t(&a3_0, 0, true, &v_13), _fx_catch_5);
      FX_CALL(_fx_cons_LN14K_form__atom_t(&a2_0, v_13, false, &v_13), _fx_catch_5);
      FX_CALL(_fx_cons_LN14K_form__atom_t(&a1_0, v_13, false, &v_13), _fx_catch_5);
      FX_CALL(
         _fx_M6K_formFM11KExpMkTupleN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(v_13, &kctx_0, &v_14),
         _fx_catch_5);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_14, code_5, fx_result);

   _fx_catch_5: ;
      if (v_14) {
         _fx_free_N14K_form__kexp_t(&v_14);
      }
      if (v_13) {
         _fx_free_LN14K_form__atom_t(&v_13);
      }
      if (code_5) {
         _fx_free_LN14K_form__kexp_t(&code_5);
      }
      _fx_free_N14K_form__atom_t(&a3_0);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_12);
      _fx_free_N14K_form__atom_t(&v_11);
      _fx_free_N14K_form__klit_t(&v_10);
      if (code_4) {
         _fx_free_LN14K_form__kexp_t(&code_4);
      }
      _fx_free_N14K_form__atom_t(&a2_0);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_9);
      if (code_3) {
         _fx_free_LN14K_form__kexp_t(&code_3);
      }
      _fx_free_N14K_form__atom_t(&a1_0);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_8);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 6) {
      if (e_0->u.ExpLit.t0.tag == 8) {
         _fx_R16Ast__val_flags_t v_15 = {0};
         _fx_N14K_form__klit_t v_16 = {0};
         _fx_N14K_form__atom_t v_17 = {0};
         _fx_N14K_form__kexp_t v_18 = 0;
         _fx_Nt6option1N14K_form__kexp_t v_19 = {0};
         _fx_LN14K_form__kexp_t code_6 = 0;
         _fx_N14K_form__atom_t v_20 = {0};
         _fx_N14K_form__kexp_t v_21 = 0;
         _fx_R9Ast__id_t z_0;
         fx_str_t slit_0 = FX_MAKE_STR("z");
         FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, &slit_0, &z_0, 0), _fx_catch_6);
         FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_15, 0), _fx_catch_6);
         _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(ktyp_0, &v_16);
         _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_16, &v_17);
         FX_CALL(
            _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_17, &kctx_0, &v_18),
            _fx_catch_6);
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(v_18, &v_19);
         FX_CALL(
            _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
               &z_0, ktyp_0, &v_15, &v_19, code_0, &eloc_0, &code_6, 0), _fx_catch_6);
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&z_0, &v_20);
         FX_CALL(
            _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_20, &kctx_0, &v_21),
            _fx_catch_6);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_21, code_6, fx_result);

      _fx_catch_6: ;
         if (v_21) {
            _fx_free_N14K_form__kexp_t(&v_21);
         }
         _fx_free_N14K_form__atom_t(&v_20);
         if (code_6) {
            _fx_free_LN14K_form__kexp_t(&code_6);
         }
         _fx_free_Nt6option1N14K_form__kexp_t(&v_19);
         if (v_18) {
            _fx_free_N14K_form__kexp_t(&v_18);
         }
         _fx_free_N14K_form__atom_t(&v_17);
         _fx_free_N14K_form__klit_t(&v_16);
         _fx_free_R16Ast__val_flags_t(&v_15);
         goto _fx_endmatch_14;
      }
   }
   if (tag_0 == 6) {
      _fx_N14K_form__klit_t v_22 = {0};
      _fx_N14K_form__atom_t v_23 = {0};
      _fx_N14K_form__kexp_t v_24 = 0;
      FX_CALL(
         _fx_M11K_normalizeFM8lit2klitN14K_form__klit_t3N10Ast__lit_tN14K_form__ktyp_tR10Ast__loc_t(&e_0->u.ExpLit.t0, ktyp_0,
            &eloc_0, &v_22, 0), _fx_catch_7);
      _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_22, &v_23);
      FX_CALL(_fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_23, &kctx_0, &v_24),
         _fx_catch_7);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_24, code_0, fx_result);

   _fx_catch_7: ;
      if (v_24) {
         _fx_free_N14K_form__kexp_t(&v_24);
      }
      _fx_free_N14K_form__atom_t(&v_23);
      _fx_free_N14K_form__klit_t(&v_22);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 7) {
      _fx_N14K_form__kexp_t v_25 = 0;
      _fx_N14K_form__atom_t v_26 = {0};
      _fx_R9Ast__id_t* n_0 = &e_0->u.ExpIdent.t0;
      int tag_1 = FX_REC_VARIANT_TAG(ktyp_0);
      _fx_R9Ast__id_t new_n_0;
      if (tag_1 == 7) {
         new_n_0 = _fx_g9Ast__noid;
      }
      else if (tag_1 == 16) {
         _fx_N15K_form__kinfo_t v_27 = {0};
         _fx_R21K_form__kdefvariant_t v_28 = {0};
         FX_CALL(_fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(&ktyp_0->u.KTypName, &eloc_0, &v_27, 0),
            _fx_catch_11);
         if (v_27.tag == 5) {
            _fx_copy_R21K_form__kdefvariant_t(&v_27.u.KVariant->data, &v_28);
            if (v_28.kvar_name.m == n_0->m) {
               fx_exn_t exn_0 = {0};
               _fx_LR9Ast__id_t kvar_ctors_0 = 0;
               _fx_Nt6option1R9Ast__id_t __fold_result___0 = _fx_g19K_normalize__None6_;
               FX_COPY_PTR(v_28.kvar_ctors, &kvar_ctors_0);
               _fx_LR9Ast__id_t lst_0 = kvar_ctors_0;
               for (; lst_0; lst_0 = lst_0->tl) {
                  _fx_R9Ast__id_t* nj_0 = &lst_0->hd;
                  _fx_R9Ast__id_t v_29;
                  FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(nj_0, &v_29, 0), _fx_catch_8);
                  _fx_R9Ast__id_t v_30;
                  FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(n_0, &v_30, 0), _fx_catch_8);
                  bool res_0;
                  FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&v_29, &v_30, &res_0, 0), _fx_catch_8);
                  if (res_0) {
                     _fx_Nt6option1R9Ast__id_t v_31;
                     _fx_M11K_normalizeFM4SomeNt6option1R9Ast__id_t1R9Ast__id_t(nj_0, &v_31);
                     __fold_result___0 = v_31;
                     FX_BREAK(_fx_catch_8);
                  }

               _fx_catch_8: ;
                  FX_CHECK_BREAK();
                  FX_CHECK_EXN(_fx_catch_9);
               }
               _fx_Nt6option1R9Ast__id_t __fold_result___1 = __fold_result___0;
               if (__fold_result___1.tag == 2) {
                  new_n_0 = __fold_result___1.u.Some;
               }
               else {
                  FX_FAST_THROW(FX_EXN_NotFoundError, _fx_catch_9);
               }
               FX_CHECK_EXN(_fx_catch_9);

            _fx_catch_9: ;
               FX_FREE_LIST_SIMPLE(&kvar_ctors_0);
               if (fx_status < 0) {
                  fx_exn_get_and_reset(fx_status, &exn_0);
                  fx_status = 0;
                  if (exn_0.tag == FX_EXN_NotFoundError) {
                     new_n_0 = *n_0;
                  }
                  else {
                     FX_RETHROW(&exn_0, _fx_catch_10);
                  }
                  FX_CHECK_EXN(_fx_catch_10);
               }

            _fx_catch_10: ;
               fx_free_exn(&exn_0);
               goto _fx_endmatch_0;
            }
         }
         new_n_0 = *n_0;

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_11);

      _fx_catch_11: ;
         _fx_free_R21K_form__kdefvariant_t(&v_28);
         _fx_free_N15K_form__kinfo_t(&v_27);
      }
      else {
         new_n_0 = *n_0;
      }
      FX_CHECK_EXN(_fx_catch_12);
      bool res_1;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&new_n_0, &_fx_g9Ast__noid, &res_1, 0), _fx_catch_12);
      if (res_1) {
         FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_25), _fx_catch_12);
      }
      else {
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&new_n_0, &v_26);
         FX_CALL(
            _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_26, &kctx_0, &v_25),
            _fx_catch_12);
      }
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_25, code_0, fx_result);

   _fx_catch_12: ;
      _fx_free_N14K_form__atom_t(&v_26);
      if (v_25) {
         _fx_free_N14K_form__kexp_t(&v_25);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 8) {
      _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_2 = &e_0->u.ExpBinary;
      if (FX_REC_VARIANT_TAG(vcase_2->t0) == 17) {
         _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_32 = {0};
         _fx_N14K_form__kexp_t e1_0 = 0;
         _fx_LN14K_form__kexp_t code_7 = 0;
         _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_33 = {0};
         _fx_N14K_form__kexp_t e2_0 = 0;
         _fx_LN14K_form__kexp_t code2_0 = 0;
         _fx_LN14K_form__kexp_t v_34 = 0;
         _fx_N14K_form__kexp_t e2_1 = 0;
         _fx_N14K_form__klit_t v_35 = {0};
         _fx_N14K_form__atom_t v_36 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_37 = {0};
         _fx_N14K_form__kexp_t v_38 = 0;
         _fx_N14K_form__kexp_t v_39 = 0;
         _fx_N10Ast__exp_t e2_2 = vcase_2->t2;
         FX_CALL(
            _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               vcase_2->t1, code_0, false, sc_0, &v_32, 0), _fx_catch_13);
         FX_COPY_PTR(v_32.t0, &e1_0);
         FX_COPY_PTR(v_32.t1, &code_7);
         _fx_R10Ast__loc_t eloc2_0;
         FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e2_2, &eloc2_0, 0), _fx_catch_13);
         FX_CALL(
            _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               e2_2, 0, false, sc_0, &v_33, 0), _fx_catch_13);
         FX_COPY_PTR(v_33.t0, &e2_0);
         FX_COPY_PTR(v_33.t1, &code2_0);
         FX_CALL(_fx_cons_LN14K_form__kexp_t(e2_0, code2_0, true, &v_34), _fx_catch_13);
         FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_34, &eloc2_0, &e2_1, 0),
            _fx_catch_13);
         _fx_M6K_formFM8KLitBoolN14K_form__klit_t1B(false, &v_35);
         _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_35, &v_36);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypBool, &eloc2_0, &v_37);
         FX_CALL(
            _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_36, &v_37, &v_38),
            _fx_catch_13);
         FX_CALL(
            _fx_M6K_formFM6KExpIfN14K_form__kexp_t4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
               e1_0, e2_1, v_38, &kctx_0, &v_39), _fx_catch_13);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_39, code_7, fx_result);

      _fx_catch_13: ;
         if (v_39) {
            _fx_free_N14K_form__kexp_t(&v_39);
         }
         if (v_38) {
            _fx_free_N14K_form__kexp_t(&v_38);
         }
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_37);
         _fx_free_N14K_form__atom_t(&v_36);
         _fx_free_N14K_form__klit_t(&v_35);
         if (e2_1) {
            _fx_free_N14K_form__kexp_t(&e2_1);
         }
         if (v_34) {
            _fx_free_LN14K_form__kexp_t(&v_34);
         }
         if (code2_0) {
            _fx_free_LN14K_form__kexp_t(&code2_0);
         }
         if (e2_0) {
            _fx_free_N14K_form__kexp_t(&e2_0);
         }
         _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_33);
         if (code_7) {
            _fx_free_LN14K_form__kexp_t(&code_7);
         }
         if (e1_0) {
            _fx_free_N14K_form__kexp_t(&e1_0);
         }
         _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_32);
         goto _fx_endmatch_14;
      }
   }
   if (tag_0 == 8) {
      _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_3 = &e_0->u.ExpBinary;
      if (FX_REC_VARIANT_TAG(vcase_3->t0) == 19) {
         _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_40 = {0};
         _fx_N14K_form__kexp_t e1_1 = 0;
         _fx_LN14K_form__kexp_t code_8 = 0;
         _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_41 = {0};
         _fx_N14K_form__kexp_t e2_3 = 0;
         _fx_LN14K_form__kexp_t code2_1 = 0;
         _fx_LN14K_form__kexp_t v_42 = 0;
         _fx_N14K_form__kexp_t e2_4 = 0;
         _fx_N14K_form__klit_t v_43 = {0};
         _fx_N14K_form__atom_t v_44 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_45 = {0};
         _fx_N14K_form__kexp_t v_46 = 0;
         _fx_N14K_form__kexp_t v_47 = 0;
         _fx_N10Ast__exp_t e2_5 = vcase_3->t2;
         FX_CALL(
            _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               vcase_3->t1, code_0, false, sc_0, &v_40, 0), _fx_catch_14);
         FX_COPY_PTR(v_40.t0, &e1_1);
         FX_COPY_PTR(v_40.t1, &code_8);
         _fx_R10Ast__loc_t eloc2_1;
         FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e2_5, &eloc2_1, 0), _fx_catch_14);
         FX_CALL(
            _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               e2_5, 0, false, sc_0, &v_41, 0), _fx_catch_14);
         FX_COPY_PTR(v_41.t0, &e2_3);
         FX_COPY_PTR(v_41.t1, &code2_1);
         FX_CALL(_fx_cons_LN14K_form__kexp_t(e2_3, code2_1, true, &v_42), _fx_catch_14);
         FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_42, &eloc2_1, &e2_4, 0),
            _fx_catch_14);
         _fx_M6K_formFM8KLitBoolN14K_form__klit_t1B(true, &v_43);
         _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_43, &v_44);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypBool, &eloc2_1, &v_45);
         FX_CALL(
            _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_44, &v_45, &v_46),
            _fx_catch_14);
         FX_CALL(
            _fx_M6K_formFM6KExpIfN14K_form__kexp_t4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
               e1_1, v_46, e2_4, &kctx_0, &v_47), _fx_catch_14);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_47, code_8, fx_result);

      _fx_catch_14: ;
         if (v_47) {
            _fx_free_N14K_form__kexp_t(&v_47);
         }
         if (v_46) {
            _fx_free_N14K_form__kexp_t(&v_46);
         }
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_45);
         _fx_free_N14K_form__atom_t(&v_44);
         _fx_free_N14K_form__klit_t(&v_43);
         if (e2_4) {
            _fx_free_N14K_form__kexp_t(&e2_4);
         }
         if (v_42) {
            _fx_free_LN14K_form__kexp_t(&v_42);
         }
         if (code2_1) {
            _fx_free_LN14K_form__kexp_t(&code2_1);
         }
         if (e2_3) {
            _fx_free_N14K_form__kexp_t(&e2_3);
         }
         _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_41);
         if (code_8) {
            _fx_free_LN14K_form__kexp_t(&code_8);
         }
         if (e1_1) {
            _fx_free_N14K_form__kexp_t(&e1_1);
         }
         _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_40);
         goto _fx_endmatch_14;
      }
   }
   if (tag_0 == 8) {
      _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_4 = &e_0->u.ExpBinary;
      if (FX_REC_VARIANT_TAG(vcase_4->t0) == 26) {
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_48 = {0};
         _fx_N14K_form__atom_t a1_1 = {0};
         _fx_LN14K_form__kexp_t code_9 = 0;
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_49 = {0};
         _fx_N14K_form__atom_t a2_1 = {0};
         _fx_LN14K_form__kexp_t code_10 = 0;
         _fx_N14K_form__kexp_t v_50 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               vcase_4->t1, code_0, false, sc_0, &v_48, 0), _fx_catch_15);
         _fx_copy_N14K_form__atom_t(&v_48.t0, &a1_1);
         FX_COPY_PTR(v_48.t1, &code_9);
         FX_CALL(
            _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               vcase_4->t2, code_9, false, sc_0, &v_49, 0), _fx_catch_15);
         _fx_copy_N14K_form__atom_t(&v_49.t0, &a2_1);
         FX_COPY_PTR(v_49.t1, &code_10);
         FX_CALL(
            _fx_M6K_formFM10KExpBinaryN14K_form__kexp_t4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
               _fx_g19K_normalize__OpCons, &a1_1, &a2_1, &kctx_0, &v_50), _fx_catch_15);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_50, code_10, fx_result);

      _fx_catch_15: ;
         if (v_50) {
            _fx_free_N14K_form__kexp_t(&v_50);
         }
         if (code_10) {
            _fx_free_LN14K_form__kexp_t(&code_10);
         }
         _fx_free_N14K_form__atom_t(&a2_1);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_49);
         if (code_9) {
            _fx_free_LN14K_form__kexp_t(&code_9);
         }
         _fx_free_N14K_form__atom_t(&a1_1);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_48);
         goto _fx_endmatch_14;
      }
   }
   if (tag_0 == 8) {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_51 = {0};
      _fx_N14K_form__atom_t a1_2 = {0};
      _fx_LN14K_form__kexp_t code_11 = 0;
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_52 = {0};
      _fx_N14K_form__atom_t a2_2 = {0};
      _fx_LN14K_form__kexp_t code_12 = 0;
      _fx_N14K_form__ktyp_t v_53 = 0;
      _fx_N14K_form__ktyp_t v_54 = 0;
      _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_5 = &e_0->u.ExpBinary;
      _fx_N13Ast__binary_t bop_0 = vcase_5->t0;
      FX_CALL(
         _fx_M11K_normalizeFM18arithm_subexp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            vcase_5->t1, code_0, false, sc_0, &v_51, 0), _fx_catch_18);
      _fx_copy_N14K_form__atom_t(&v_51.t0, &a1_2);
      FX_COPY_PTR(v_51.t1, &code_11);
      FX_CALL(
         _fx_M11K_normalizeFM18arithm_subexp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            vcase_5->t2, code_11, false, sc_0, &v_52, 0), _fx_catch_18);
      _fx_copy_N14K_form__atom_t(&v_52.t0, &a2_2);
      FX_COPY_PTR(v_52.t1, &code_12);
      FX_CALL(_fx_M6K_formFM13get_atom_ktypN14K_form__ktyp_t2N14K_form__atom_tR10Ast__loc_t(&a1_2, &eloc_0, &v_53, 0),
         _fx_catch_18);
      FX_CALL(_fx_M6K_formFM13get_atom_ktypN14K_form__ktyp_t2N14K_form__atom_tR10Ast__loc_t(&a2_2, &eloc_0, &v_54, 0),
         _fx_catch_18);
      bool res_2;
      if (FX_REC_VARIANT_TAG(bop_0) == 1) {
         if (FX_REC_VARIANT_TAG(v_53) == 10) {
            if (FX_REC_VARIANT_TAG(v_54) == 10) {
               res_2 = true; goto _fx_endmatch_1;
            }
         }
      }
      if (FX_REC_VARIANT_TAG(bop_0) == 1) {
         if (FX_REC_VARIANT_TAG(v_53) == 9) {
            if (FX_REC_VARIANT_TAG(v_54) == 10) {
               res_2 = true; goto _fx_endmatch_1;
            }
         }
      }
      if (FX_REC_VARIANT_TAG(bop_0) == 1) {
         if (FX_REC_VARIANT_TAG(v_53) == 10) {
            if (FX_REC_VARIANT_TAG(v_54) == 9) {
               res_2 = true; goto _fx_endmatch_1;
            }
         }
      }
      res_2 = false;

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_18);
      if (res_2) {
         _fx_LN14K_form__atom_t v_55 = 0;
         _fx_N14K_form__kexp_t v_56 = 0;
         FX_CALL(_fx_cons_LN14K_form__atom_t(&a2_2, 0, true, &v_55), _fx_catch_16);
         FX_CALL(_fx_cons_LN14K_form__atom_t(&a1_2, v_55, false, &v_55), _fx_catch_16);
         FX_CALL(
            _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
               &_fx_g28K_normalize__IntrinStrConcat, v_55, &kctx_0, &v_56), _fx_catch_16);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_56, code_12, fx_result);

      _fx_catch_16: ;
         if (v_56) {
            _fx_free_N14K_form__kexp_t(&v_56);
         }
         if (v_55) {
            _fx_free_LN14K_form__atom_t(&v_55);
         }
         goto _fx_endmatch_2;
      }
      _fx_N14K_form__kexp_t v_57 = 0;
      FX_CALL(
         _fx_M6K_formFM10KExpBinaryN14K_form__kexp_t4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            bop_0, &a1_2, &a2_2, &kctx_0, &v_57), _fx_catch_17);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_57, code_12, fx_result);

   _fx_catch_17: ;
      if (v_57) {
         _fx_free_N14K_form__kexp_t(&v_57);
      }

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_18);

   _fx_catch_18: ;
      if (v_54) {
         _fx_free_N14K_form__ktyp_t(&v_54);
      }
      if (v_53) {
         _fx_free_N14K_form__ktyp_t(&v_53);
      }
      if (code_12) {
         _fx_free_LN14K_form__kexp_t(&code_12);
      }
      _fx_free_N14K_form__atom_t(&a2_2);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_52);
      if (code_11) {
         _fx_free_LN14K_form__kexp_t(&code_11);
      }
      _fx_free_N14K_form__atom_t(&a1_2);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_51);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 9) {
      _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_6 = &e_0->u.ExpUnary;
      if (vcase_6->t0.tag == 7) {
         _fx_T2R9Ast__id_tLN14K_form__kexp_t v_58 = {0};
         _fx_LN14K_form__kexp_t code_13 = 0;
         _fx_N14K_form__atom_t v_59 = {0};
         _fx_N14K_form__kexp_t v_60 = 0;
         fx_str_t slit_1 = FX_MAKE_STR("a literal cannot be dereferenced");
         FX_CALL(
            _fx_M11K_normalizeFM6exp2idT2R9Ast__id_tLN14K_form__kexp_t5N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_tS(
               vcase_6->t1, code_0, false, sc_0, &slit_1, &v_58, 0), _fx_catch_19);
         _fx_R9Ast__id_t a_id_0 = v_58.t0;
         FX_COPY_PTR(v_58.t1, &code_13);
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&a_id_0, &v_59);
         FX_CALL(
            _fx_M6K_formFM9KExpUnaryN14K_form__kexp_t3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
               &_fx_g20K_normalize__OpDeref, &v_59, &kctx_0, &v_60), _fx_catch_19);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_60, code_13, fx_result);

      _fx_catch_19: ;
         if (v_60) {
            _fx_free_N14K_form__kexp_t(&v_60);
         }
         _fx_free_N14K_form__atom_t(&v_59);
         if (code_13) {
            _fx_free_LN14K_form__kexp_t(&code_13);
         }
         _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_58);
         goto _fx_endmatch_14;
      }
   }
   if (tag_0 == 9) {
      _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_7 = &e_0->u.ExpUnary;
      if (vcase_7->t0.tag == 3) {
         _fx_LT2N14K_form__atom_ti idx_access_stack_0 = 0;
         _fx_T2N14K_form__atom_ti v_61 = {0};
         _fx_N14K_form__atom_t arr_0 = {0};
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_62 = {0};
         _fx_N14K_form__atom_t a_1 = {0};
         _fx_LN14K_form__kexp_t code_14 = 0;
         _fx_LN14K_form__atom_t args_0 = 0;
         _fx_N14K_form__klit_t v_63 = {0};
         _fx_N14K_form__atom_t v_64 = {0};
         _fx_LN14K_form__atom_t v_65 = 0;
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_66 = {0};
         _fx_N14K_form__kexp_t v_67 = 0;
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_68 = {0};
         _fx_N14K_form__atom_t sz_0 = {0};
         _fx_LN14K_form__kexp_t code_15 = 0;
         _fx_N14K_form__kexp_t v_69 = 0;
         FX_COPY_PTR(_fx_g29K_normalize__idx_access_stack, &idx_access_stack_0);
         if (idx_access_stack_0 != 0) {
            _fx_T2N14K_form__atom_ti* v_70 = &idx_access_stack_0->hd; _fx_make_T2N14K_form__atom_ti(&v_70->t0, v_70->t1, &v_61);
         }
         else {
            fx_exn_t v_71 = {0};
            fx_str_t slit_2 =
               FX_MAKE_STR(".- is only allowed inside array access op. .- inside of tuple indexes is not supported too.");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&eloc_0, &slit_2, &v_71, 0), _fx_catch_20);
            FX_THROW(&v_71, false, _fx_catch_20);

         _fx_catch_20: ;
            fx_free_exn(&v_71);
         }
         FX_CHECK_EXN(_fx_catch_21);
         _fx_copy_N14K_form__atom_t(&v_61.t0, &arr_0);
         int_ idx_i_0 = v_61.t1;
         FX_CALL(
            _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               vcase_7->t1, code_0, false, sc_0, &v_62, 0), _fx_catch_21);
         _fx_copy_N14K_form__atom_t(&v_62.t0, &a_1);
         FX_COPY_PTR(v_62.t1, &code_14);
         if (idx_i_0 == 0) {
            FX_CALL(_fx_cons_LN14K_form__atom_t(&arr_0, 0, true, &args_0), _fx_catch_21);
         }
         else {
            int64_t res_3;
            FX_CALL(_fx_M11K_normalizeFM5int64l1i(idx_i_0, &res_3, 0), _fx_catch_21);
            _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(res_3, &v_63);
            _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_63, &v_64);
            FX_CALL(_fx_cons_LN14K_form__atom_t(&v_64, 0, true, &v_65), _fx_catch_21);
            FX_CALL(_fx_cons_LN14K_form__atom_t(&arr_0, v_65, true, &args_0), _fx_catch_21);
         }
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g20K_normalize__KTypInt, &eloc_0, &v_66);
         FX_CALL(
            _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
               &_fx_g26K_normalize__IntrinGetSize, args_0, &v_66, &v_67), _fx_catch_21);
         fx_str_t slit_3 = FX_MAKE_STR("sz");
         FX_CALL(
            _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(km_idx_0,
               &slit_3, v_67, false, code_14, &v_68, 0), _fx_catch_21);
         _fx_copy_N14K_form__atom_t(&v_68.t0, &sz_0);
         FX_COPY_PTR(v_68.t1, &code_15);
         FX_CALL(
            _fx_M6K_formFM10KExpBinaryN14K_form__kexp_t4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
               _fx_g18K_normalize__OpSub, &sz_0, &a_1, &kctx_0, &v_69), _fx_catch_21);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_69, code_15, fx_result);

      _fx_catch_21: ;
         if (v_69) {
            _fx_free_N14K_form__kexp_t(&v_69);
         }
         if (code_15) {
            _fx_free_LN14K_form__kexp_t(&code_15);
         }
         _fx_free_N14K_form__atom_t(&sz_0);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_68);
         if (v_67) {
            _fx_free_N14K_form__kexp_t(&v_67);
         }
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_66);
         if (v_65) {
            _fx_free_LN14K_form__atom_t(&v_65);
         }
         _fx_free_N14K_form__atom_t(&v_64);
         _fx_free_N14K_form__klit_t(&v_63);
         if (args_0) {
            _fx_free_LN14K_form__atom_t(&args_0);
         }
         if (code_14) {
            _fx_free_LN14K_form__kexp_t(&code_14);
         }
         _fx_free_N14K_form__atom_t(&a_1);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_62);
         _fx_free_N14K_form__atom_t(&arr_0);
         _fx_free_T2N14K_form__atom_ti(&v_61);
         if (idx_access_stack_0) {
            _fx_free_LT2N14K_form__atom_ti(&idx_access_stack_0);
         }
         goto _fx_endmatch_14;
      }
   }
   if (tag_0 == 9) {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_72 = {0};
      _fx_N14K_form__atom_t a1_3 = {0};
      _fx_LN14K_form__kexp_t code_16 = 0;
      _fx_N14K_form__kexp_t v_73 = 0;
      _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_8 = &e_0->u.ExpUnary;
      _fx_N10Ast__exp_t e1_2 = vcase_8->t1;
      _fx_N12Ast__unary_t* uop_0 = &vcase_8->t0;
      int tag_2 = uop_0->tag;
      bool res_4;
      if (tag_2 == 1) {
         res_4 = true;
      }
      else if (tag_2 == 2) {
         res_4 = true;
      }
      else {
         res_4 = false;
      }
      FX_CHECK_EXN(_fx_catch_24);
      if (res_4) {
         FX_CALL(
            _fx_M11K_normalizeFM18arithm_subexp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               e1_2, code_0, false, sc_0, &v_72, 0), _fx_catch_22);

      _fx_catch_22: ;
         goto _fx_endmatch_3;
      }
      FX_CALL(
         _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e1_2, code_0, false, sc_0, &v_72, 0), _fx_catch_23);

   _fx_catch_23: ;

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_24);
      _fx_copy_N14K_form__atom_t(&v_72.t0, &a1_3);
      FX_COPY_PTR(v_72.t1, &code_16);
      FX_CALL(
         _fx_M6K_formFM9KExpUnaryN14K_form__kexp_t3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(uop_0,
            &a1_3, &kctx_0, &v_73), _fx_catch_24);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_73, code_16, fx_result);

   _fx_catch_24: ;
      if (v_73) {
         _fx_free_N14K_form__kexp_t(&v_73);
      }
      if (code_16) {
         _fx_free_LN14K_form__kexp_t(&code_16);
      }
      _fx_free_N14K_form__atom_t(&a1_3);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_72);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 10) {
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t __fold_result___2 = {0};
      _fx_LN10Ast__exp_t args_1 = 0;
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_74 = {0};
      _fx_LN14K_form__atom_t args_2 = 0;
      _fx_LN14K_form__kexp_t code_17 = 0;
      _fx_LN14K_form__atom_t v_75 = 0;
      _fx_N14K_form__kexp_t v_76 = 0;
      _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_9 = &e_0->u.ExpIntrin;
      _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(0, code_0, &__fold_result___2);
      FX_COPY_PTR(vcase_9->t1, &args_1);
      _fx_LN10Ast__exp_t lst_1 = args_1;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_77 = {0};
         _fx_LN14K_form__atom_t args_3 = 0;
         _fx_LN14K_form__kexp_t code_18 = 0;
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_78 = {0};
         _fx_N14K_form__atom_t ai_0 = {0};
         _fx_LN14K_form__kexp_t code_19 = 0;
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_79 = {0};
         _fx_N10Ast__exp_t ei_0 = lst_1->hd;
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___2, &v_77);
         FX_COPY_PTR(v_77.t0, &args_3);
         FX_COPY_PTR(v_77.t1, &code_18);
         FX_CALL(
            _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               ei_0, code_18, false, sc_0, &v_78, 0), _fx_catch_25);
         _fx_copy_N14K_form__atom_t(&v_78.t0, &ai_0);
         FX_COPY_PTR(v_78.t1, &code_19);
         FX_CALL(_fx_cons_LN14K_form__atom_t(&ai_0, args_3, false, &args_3), _fx_catch_25);
         _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(args_3, code_19, &v_79);
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___2);
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_79, &__fold_result___2);

      _fx_catch_25: ;
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_79);
         if (code_19) {
            _fx_free_LN14K_form__kexp_t(&code_19);
         }
         _fx_free_N14K_form__atom_t(&ai_0);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_78);
         if (code_18) {
            _fx_free_LN14K_form__kexp_t(&code_18);
         }
         if (args_3) {
            _fx_free_LN14K_form__atom_t(&args_3);
         }
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_77);
         FX_CHECK_EXN(_fx_catch_26);
      }
      _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___2, &v_74);
      FX_COPY_PTR(v_74.t0, &args_2);
      FX_COPY_PTR(v_74.t1, &code_17);
      FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__atom_t1LN14K_form__atom_t(args_2, &v_75, 0), _fx_catch_26);
      FX_CALL(
         _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &vcase_9->t0, v_75, &kctx_0, &v_76), _fx_catch_26);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_76, code_17, fx_result);

   _fx_catch_26: ;
      if (v_76) {
         _fx_free_N14K_form__kexp_t(&v_76);
      }
      if (v_75) {
         _fx_free_LN14K_form__atom_t(&v_75);
      }
      if (code_17) {
         _fx_free_LN14K_form__kexp_t(&code_17);
      }
      if (args_2) {
         _fx_free_LN14K_form__atom_t(&args_2);
      }
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_74);
      if (args_1) {
         _fx_free_LN10Ast__exp_t(&args_1);
      }
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___2);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 12) {
      _fx_LN12Ast__scope_t sc_1 = 0;
      _fx_LN14K_form__kexp_t code_20 = 0;
      _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t v_80 = {0};
      _fx_LN14K_form__kexp_t code_21 = 0;
      _fx_LN10Ast__exp_t eseq_0 = e_0->u.ExpSeq.t0;
      _fx_N12Ast__scope_t v_81;
      FX_CALL(_fx_M3AstFM15new_block_scopeN12Ast__scope_t1i(km_idx_0, &v_81, 0), _fx_catch_28);
      FX_CALL(_fx_cons_LN12Ast__scope_t(&v_81, sc_0, true, &sc_1), _fx_catch_28);
      FX_CALL(
         _fx_M11K_normalizeFM28transform_all_types_and_consLN14K_form__kexp_t3LN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
            eseq_0, code_0, sc_1, &code_20, 0), _fx_catch_28);
      FX_CALL(
         _fx_M11K_normalizeFM9eseq2codeT2LN14K_form__kexp_tLT2SR10Ast__loc_t3LN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
            eseq_0, code_20, sc_1, &v_80, 0), _fx_catch_28);
      FX_COPY_PTR(v_80.t0, &code_21);
      if (code_21 != 0) {
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(code_21->hd, code_21->tl, fx_result);
      }
      else {
         _fx_N14K_form__kexp_t v_82 = 0;
         FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_82), _fx_catch_27);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_82, code_21, fx_result);

      _fx_catch_27: ;
         if (v_82) {
            _fx_free_N14K_form__kexp_t(&v_82);
         }
      }
      FX_CHECK_EXN(_fx_catch_28);

   _fx_catch_28: ;
      if (code_21) {
         _fx_free_LN14K_form__kexp_t(&code_21);
      }
      _fx_free_T2LN14K_form__kexp_tLT2SR10Ast__loc_t(&v_80);
      if (code_20) {
         _fx_free_LN14K_form__kexp_t(&code_20);
      }
      FX_FREE_LIST_SIMPLE(&sc_1);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 11) {
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_83 = {0};
      _fx_N14K_form__kexp_t e_1 = 0;
      _fx_LN14K_form__kexp_t code1_0 = 0;
      _fx_LN14K_form__kexp_t v_84 = 0;
      _fx_N14K_form__kexp_t v_85 = 0;
      _fx_N14K_form__kexp_t v_86 = 0;
      _fx_T2R9Ast__id_tN10Ast__exp_t* vcase_10 = &e_0->u.ExpSync;
      _fx_N10Ast__exp_t e0_0 = vcase_10->t1;
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e0_0, 0, false, sc_0, &v_83, 0), _fx_catch_29);
      FX_COPY_PTR(v_83.t0, &e_1);
      FX_COPY_PTR(v_83.t1, &code1_0);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(e_1, code1_0, true, &v_84), _fx_catch_29);
      _fx_R10Ast__loc_t v_87;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e0_0, &v_87, 0), _fx_catch_29);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_84, &v_87, &v_85, 0), _fx_catch_29);
      FX_CALL(_fx_M6K_formFM8KExpSyncN14K_form__kexp_t2R9Ast__id_tN14K_form__kexp_t(&vcase_10->t0, v_85, &v_86), _fx_catch_29);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_86, code_0, fx_result);

   _fx_catch_29: ;
      if (v_86) {
         _fx_free_N14K_form__kexp_t(&v_86);
      }
      if (v_85) {
         _fx_free_N14K_form__kexp_t(&v_85);
      }
      if (v_84) {
         _fx_free_LN14K_form__kexp_t(&v_84);
      }
      if (code1_0) {
         _fx_free_LN14K_form__kexp_t(&code1_0);
      }
      if (e_1) {
         _fx_free_N14K_form__kexp_t(&e_1);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_83);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 13) {
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t __fold_result___3 = {0};
      _fx_LN10Ast__exp_t args_4 = 0;
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_88 = {0};
      _fx_LN14K_form__atom_t args_5 = 0;
      _fx_LN14K_form__kexp_t code_22 = 0;
      _fx_LN14K_form__atom_t v_89 = 0;
      _fx_N14K_form__kexp_t v_90 = 0;
      _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(0, code_0, &__fold_result___3);
      FX_COPY_PTR(e_0->u.ExpMkTuple.t0, &args_4);
      _fx_LN10Ast__exp_t lst_2 = args_4;
      for (; lst_2; lst_2 = lst_2->tl) {
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_91 = {0};
         _fx_LN14K_form__atom_t args_6 = 0;
         _fx_LN14K_form__kexp_t code_23 = 0;
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_92 = {0};
         _fx_N14K_form__atom_t ai_1 = {0};
         _fx_LN14K_form__kexp_t code_24 = 0;
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_93 = {0};
         _fx_N10Ast__exp_t ei_1 = lst_2->hd;
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___3, &v_91);
         FX_COPY_PTR(v_91.t0, &args_6);
         FX_COPY_PTR(v_91.t1, &code_23);
         FX_CALL(
            _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               ei_1, code_23, false, sc_0, &v_92, 0), _fx_catch_30);
         _fx_copy_N14K_form__atom_t(&v_92.t0, &ai_1);
         FX_COPY_PTR(v_92.t1, &code_24);
         FX_CALL(_fx_cons_LN14K_form__atom_t(&ai_1, args_6, false, &args_6), _fx_catch_30);
         _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(args_6, code_24, &v_93);
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___3);
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_93, &__fold_result___3);

      _fx_catch_30: ;
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_93);
         if (code_24) {
            _fx_free_LN14K_form__kexp_t(&code_24);
         }
         _fx_free_N14K_form__atom_t(&ai_1);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_92);
         if (code_23) {
            _fx_free_LN14K_form__kexp_t(&code_23);
         }
         if (args_6) {
            _fx_free_LN14K_form__atom_t(&args_6);
         }
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_91);
         FX_CHECK_EXN(_fx_catch_31);
      }
      _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___3, &v_88);
      FX_COPY_PTR(v_88.t0, &args_5);
      FX_COPY_PTR(v_88.t1, &code_22);
      FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__atom_t1LN14K_form__atom_t(args_5, &v_89, 0), _fx_catch_31);
      FX_CALL(
         _fx_M6K_formFM11KExpMkTupleN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(v_89, &kctx_0, &v_90),
         _fx_catch_31);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_90, code_22, fx_result);

   _fx_catch_31: ;
      if (v_90) {
         _fx_free_N14K_form__kexp_t(&v_90);
      }
      if (v_89) {
         _fx_free_LN14K_form__atom_t(&v_89);
      }
      if (code_22) {
         _fx_free_LN14K_form__kexp_t(&code_22);
      }
      if (args_5) {
         _fx_free_LN14K_form__atom_t(&args_5);
      }
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_88);
      if (args_4) {
         _fx_free_LN10Ast__exp_t(&args_4);
      }
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___3);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 14) {
      fx_exn_t v_94 = {0};
      _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB __fold_result___4 = {0};
      _fx_LLN10Ast__exp_t arows_0 = 0;
      _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB v_95 = {0};
      _fx_LLT2BN14K_form__atom_t krows_0 = 0;
      _fx_LN14K_form__kexp_t code_25 = 0;
      _fx_LLT2BN14K_form__atom_t v_96 = 0;
      _fx_N14K_form__kexp_t v_97 = 0;
      _fx_LLN10Ast__exp_t arows_1 = e_0->u.ExpMkArray.t0;
      if (arows_1 == 0) {
         fx_str_t slit_4 = FX_MAKE_STR("empty arrays are not supported");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&eloc_0, &slit_4, &v_94, 0), _fx_catch_34);
         FX_THROW(&v_94, false, _fx_catch_34);
      }
      _fx_make_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(0, code_0, true, &__fold_result___4);
      FX_COPY_PTR(arows_1, &arows_0);
      _fx_LLN10Ast__exp_t lst_3 = arows_0;
      for (; lst_3; lst_3 = lst_3->tl) {
         _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB v_98 = {0};
         _fx_LLT2BN14K_form__atom_t krows_1 = 0;
         _fx_LN14K_form__kexp_t code_26 = 0;
         _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB __fold_result___5 = {0};
         _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB v_99 = {0};
         _fx_LT2BN14K_form__atom_t krow_0 = 0;
         _fx_LN14K_form__kexp_t code_27 = 0;
         _fx_LT2BN14K_form__atom_t v_100 = 0;
         _fx_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB v_101 = {0};
         _fx_LN10Ast__exp_t arow_0 = lst_3->hd;
         _fx_copy_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(&__fold_result___4, &v_98);
         FX_COPY_PTR(v_98.t0, &krows_1);
         FX_COPY_PTR(v_98.t1, &code_26);
         _fx_make_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(0, code_26, v_98.t2, &__fold_result___5);
         _fx_LN10Ast__exp_t lst_4 = arow_0;
         for (; lst_4; lst_4 = lst_4->tl) {
            _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB v_102 = {0};
            _fx_LT2BN14K_form__atom_t krow_1 = 0;
            _fx_LN14K_form__kexp_t code_28 = 0;
            _fx_T3BN10Ast__exp_tB v_103 = {0};
            _fx_N10Ast__exp_t e_2 = 0;
            _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_104 = {0};
            _fx_N14K_form__atom_t a_2 = {0};
            _fx_LN14K_form__kexp_t code_29 = 0;
            _fx_T2BN14K_form__atom_t v_105 = {0};
            _fx_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB v_106 = {0};
            _fx_N10Ast__exp_t e_3 = lst_4->hd;
            _fx_copy_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(&__fold_result___5, &v_102);
            FX_COPY_PTR(v_102.t0, &krow_1);
            FX_COPY_PTR(v_102.t1, &code_28);
            int tag_3 = FX_REC_VARIANT_TAG(e_3);
            if (tag_3 == 9) {
               _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_11 = &e_3->u.ExpUnary;
               if (vcase_11->t0.tag == 8) {
                  _fx_make_T3BN10Ast__exp_tB(true, vcase_11->t1, false, &v_103); goto _fx_endmatch_4;
               }
            }
            if (tag_3 == 6) {
               _fx_N10Ast__lit_t* v_107 = &e_3->u.ExpLit.t0;
               bool res_5;
               if (v_107->tag == 5) {
                  res_5 = true;
               }
               else if (v_107->tag == 9) {
                  res_5 = true;
               }
               else if (v_107->tag == 8) {
                  res_5 = true;
               }
               else {
                  res_5 = false;
               }
               FX_CHECK_EXN(_fx_catch_32);
               if (res_5) {
                  _fx_make_T3BN10Ast__exp_tB(false, e_3, false, &v_103); goto _fx_endmatch_4;
               }
            }
            if (tag_3 == 6) {
               _fx_make_T3BN10Ast__exp_tB(false, e_3, true, &v_103); goto _fx_endmatch_4;
            }
            _fx_make_T3BN10Ast__exp_tB(false, e_3, false, &v_103);

         _fx_endmatch_4: ;
            FX_CHECK_EXN(_fx_catch_32);
            bool f_0 = v_103.t0;
            FX_COPY_PTR(v_103.t1, &e_2);
            bool islit_0 = v_103.t2;
            FX_CALL(
               _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
                  e_2, code_28, false, sc_0, &v_104, 0), _fx_catch_32);
            _fx_copy_N14K_form__atom_t(&v_104.t0, &a_2);
            FX_COPY_PTR(v_104.t1, &code_29);
            _fx_make_T2BN14K_form__atom_t(f_0, &a_2, &v_105);
            FX_CALL(_fx_cons_LT2BN14K_form__atom_t(&v_105, krow_1, false, &krow_1), _fx_catch_32);
            _fx_make_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(krow_1, code_29, (bool)(v_102.t2 & islit_0), &v_106);
            _fx_free_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(&__fold_result___5);
            _fx_copy_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(&v_106, &__fold_result___5);

         _fx_catch_32: ;
            _fx_free_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(&v_106);
            _fx_free_T2BN14K_form__atom_t(&v_105);
            if (code_29) {
               _fx_free_LN14K_form__kexp_t(&code_29);
            }
            _fx_free_N14K_form__atom_t(&a_2);
            _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_104);
            if (e_2) {
               _fx_free_N10Ast__exp_t(&e_2);
            }
            _fx_free_T3BN10Ast__exp_tB(&v_103);
            if (code_28) {
               _fx_free_LN14K_form__kexp_t(&code_28);
            }
            if (krow_1) {
               _fx_free_LT2BN14K_form__atom_t(&krow_1);
            }
            _fx_free_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(&v_102);
            FX_CHECK_EXN(_fx_catch_33);
         }
         _fx_copy_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(&__fold_result___5, &v_99);
         FX_COPY_PTR(v_99.t0, &krow_0);
         FX_COPY_PTR(v_99.t1, &code_27);
         bool all_literals_0 = v_99.t2;
         FX_CALL(_fx_M11K_normalizeFM3revLT2BN14K_form__atom_t1LT2BN14K_form__atom_t(krow_0, &v_100, 0), _fx_catch_33);
         FX_CALL(_fx_cons_LLT2BN14K_form__atom_t(v_100, krows_1, false, &krows_1), _fx_catch_33);
         _fx_make_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(krows_1, code_27, all_literals_0, &v_101);
         _fx_free_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(&__fold_result___4);
         _fx_copy_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(&v_101, &__fold_result___4);

      _fx_catch_33: ;
         _fx_free_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(&v_101);
         if (v_100) {
            _fx_free_LT2BN14K_form__atom_t(&v_100);
         }
         if (code_27) {
            _fx_free_LN14K_form__kexp_t(&code_27);
         }
         if (krow_0) {
            _fx_free_LT2BN14K_form__atom_t(&krow_0);
         }
         _fx_free_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(&v_99);
         _fx_free_T3LT2BN14K_form__atom_tLN14K_form__kexp_tB(&__fold_result___5);
         if (code_26) {
            _fx_free_LN14K_form__kexp_t(&code_26);
         }
         if (krows_1) {
            _fx_free_LLT2BN14K_form__atom_t(&krows_1);
         }
         _fx_free_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(&v_98);
         FX_CHECK_EXN(_fx_catch_34);
      }
      _fx_copy_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(&__fold_result___4, &v_95);
      FX_COPY_PTR(v_95.t0, &krows_0);
      FX_COPY_PTR(v_95.t1, &code_25);
      bool all_literals_1 = v_95.t2;
      FX_CALL(_fx_M11K_normalizeFM3revLLT2BN14K_form__atom_t1LLT2BN14K_form__atom_t(krows_0, &v_96, 0), _fx_catch_34);
      FX_CALL(
         _fx_M6K_formFM11KExpMkArrayN14K_form__kexp_t3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(all_literals_1,
            v_96, &kctx_0, &v_97), _fx_catch_34);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_97, code_25, fx_result);

   _fx_catch_34: ;
      if (v_97) {
         _fx_free_N14K_form__kexp_t(&v_97);
      }
      if (v_96) {
         _fx_free_LLT2BN14K_form__atom_t(&v_96);
      }
      if (code_25) {
         _fx_free_LN14K_form__kexp_t(&code_25);
      }
      if (krows_0) {
         _fx_free_LLT2BN14K_form__atom_t(&krows_0);
      }
      _fx_free_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(&v_95);
      if (arows_0) {
         _fx_free_LLN10Ast__exp_t(&arows_0);
      }
      _fx_free_T3LLT2BN14K_form__atom_tLN14K_form__kexp_tB(&__fold_result___4);
      fx_free_exn(&v_94);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 15) {
      fx_exn_t v_108 = {0};
      _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t __fold_result___6 = {0};
      _fx_LN10Ast__exp_t elems_0 = 0;
      _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t v_109 = {0};
      _fx_LT2BN14K_form__atom_t elems_1 = 0;
      _fx_LN14K_form__kexp_t code_30 = 0;
      _fx_LT2BN14K_form__atom_t v_110 = 0;
      _fx_N14K_form__kexp_t v_111 = 0;
      _fx_LN10Ast__exp_t elems_2 = e_0->u.ExpMkVector.t0;
      if (elems_2 == 0) {
         fx_str_t slit_5 = FX_MAKE_STR("empty vector literals are not supported");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&eloc_0, &slit_5, &v_108, 0), _fx_catch_36);
         FX_THROW(&v_108, false, _fx_catch_36);
      }
      _fx_make_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(0, code_0, &__fold_result___6);
      FX_COPY_PTR(elems_2, &elems_0);
      _fx_LN10Ast__exp_t lst_5 = elems_0;
      for (; lst_5; lst_5 = lst_5->tl) {
         _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t v_112 = {0};
         _fx_LT2BN14K_form__atom_t elems_3 = 0;
         _fx_LN14K_form__kexp_t code_31 = 0;
         _fx_T2BN10Ast__exp_t v_113 = {0};
         _fx_N10Ast__exp_t e_4 = 0;
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_114 = {0};
         _fx_N14K_form__atom_t a_3 = {0};
         _fx_LN14K_form__kexp_t code_32 = 0;
         _fx_T2BN14K_form__atom_t v_115 = {0};
         _fx_T2LT2BN14K_form__atom_tLN14K_form__kexp_t v_116 = {0};
         _fx_N10Ast__exp_t e_5 = lst_5->hd;
         _fx_copy_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___6, &v_112);
         FX_COPY_PTR(v_112.t0, &elems_3);
         FX_COPY_PTR(v_112.t1, &code_31);
         if (FX_REC_VARIANT_TAG(e_5) == 9) {
            _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_12 = &e_5->u.ExpUnary;
            if (vcase_12->t0.tag == 8) {
               _fx_make_T2BN10Ast__exp_t(true, vcase_12->t1, &v_113); goto _fx_endmatch_5;
            }
         }
         _fx_make_T2BN10Ast__exp_t(false, e_5, &v_113);

      _fx_endmatch_5: ;
         FX_CHECK_EXN(_fx_catch_35);
         bool f_1 = v_113.t0;
         FX_COPY_PTR(v_113.t1, &e_4);
         FX_CALL(
            _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               e_4, code_31, false, sc_0, &v_114, 0), _fx_catch_35);
         _fx_copy_N14K_form__atom_t(&v_114.t0, &a_3);
         FX_COPY_PTR(v_114.t1, &code_32);
         _fx_make_T2BN14K_form__atom_t(f_1, &a_3, &v_115);
         FX_CALL(_fx_cons_LT2BN14K_form__atom_t(&v_115, elems_3, false, &elems_3), _fx_catch_35);
         _fx_make_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(elems_3, code_32, &v_116);
         _fx_free_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___6);
         _fx_copy_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(&v_116, &__fold_result___6);

      _fx_catch_35: ;
         _fx_free_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(&v_116);
         _fx_free_T2BN14K_form__atom_t(&v_115);
         if (code_32) {
            _fx_free_LN14K_form__kexp_t(&code_32);
         }
         _fx_free_N14K_form__atom_t(&a_3);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_114);
         if (e_4) {
            _fx_free_N10Ast__exp_t(&e_4);
         }
         _fx_free_T2BN10Ast__exp_t(&v_113);
         if (code_31) {
            _fx_free_LN14K_form__kexp_t(&code_31);
         }
         if (elems_3) {
            _fx_free_LT2BN14K_form__atom_t(&elems_3);
         }
         _fx_free_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(&v_112);
         FX_CHECK_EXN(_fx_catch_36);
      }
      _fx_copy_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___6, &v_109);
      FX_COPY_PTR(v_109.t0, &elems_1);
      FX_COPY_PTR(v_109.t1, &code_30);
      FX_CALL(_fx_M11K_normalizeFM3revLT2BN14K_form__atom_t1LT2BN14K_form__atom_t(elems_1, &v_110, 0), _fx_catch_36);
      FX_CALL(
         _fx_M6K_formFM12KExpMkVectorN14K_form__kexp_t2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(v_110, &kctx_0,
            &v_111), _fx_catch_36);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_111, code_30, fx_result);

   _fx_catch_36: ;
      if (v_111) {
         _fx_free_N14K_form__kexp_t(&v_111);
      }
      if (v_110) {
         _fx_free_LT2BN14K_form__atom_t(&v_110);
      }
      if (code_30) {
         _fx_free_LN14K_form__kexp_t(&code_30);
      }
      if (elems_1) {
         _fx_free_LT2BN14K_form__atom_t(&elems_1);
      }
      _fx_free_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(&v_109);
      if (elems_0) {
         _fx_free_LN10Ast__exp_t(&elems_0);
      }
      _fx_free_T2LT2BN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___6);
      fx_free_exn(&v_108);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 16) {
      _fx_N10Ast__typ_t v_117 = 0;
      _fx_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t v_118 = {0};
      _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_119 = {0};
      _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_0 = 0;
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t __fold_result___7 = {0};
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_120 = {0};
      _fx_LN14K_form__atom_t ratoms_0 = 0;
      _fx_LN14K_form__kexp_t code_33 = 0;
      _fx_LN14K_form__atom_t v_121 = 0;
      _fx_N14K_form__kexp_t v_122 = 0;
      _fx_LN14K_form__atom_t v_123 = 0;
      _fx_N14K_form__kexp_t v_124 = 0;
      _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_13 = &e_0->u.ExpMkRecord;
      _fx_N10Ast__exp_t rn_0 = vcase_13->t0;
      FX_CALL(_fx_M3AstFM9deref_typN10Ast__typ_t1N10Ast__typ_t(etyp_0, &v_117, 0), _fx_catch_45);
      if (FX_REC_VARIANT_TAG(rn_0) == 7) {
         _fx_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t v_125 = {0};
         _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_1 = 0;
         _fx_R9Ast__id_t* rn_id_0 = &rn_0->u.ExpIdent.t0;
         _fx_Nt6option1R9Ast__id_t v_126;
         _fx_M11K_normalizeFM4SomeNt6option1R9Ast__id_t1R9Ast__id_t(rn_id_0, &v_126);
         FX_CALL(
            _fx_M13Ast_typecheckFM16get_record_elemsT2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t4Nt6option1R9Ast__id_tN10Ast__typ_tBR10Ast__loc_t(
               &v_126, etyp_0, false, &eloc_0, &v_125, 0), _fx_catch_37);
         _fx_R9Ast__id_t ctor_0 = v_125.t0;
         FX_COPY_PTR(v_125.t1, &relems_1);
         _fx_make_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(rn_id_0, &ctor_0,
            relems_1, &v_118);

      _fx_catch_37: ;
         if (relems_1) {
            _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_1);
         }
         _fx_free_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&v_125);
         goto _fx_endmatch_6;
      }
      if (FX_REC_VARIANT_TAG(rn_0) == 1) {
         if (FX_REC_VARIANT_TAG(v_117) == 20) {
            _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_117->u.TypRecord->data, &v_119);
            if (v_119.t1 == true) {
               _fx_make_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&_fx_g9Ast__noid,
                  &_fx_g9Ast__noid, v_119.t0, &v_118);
               goto _fx_endmatch_6;
            }
         }
      }
      fx_exn_t v_127 = {0};
      _fx_R10Ast__loc_t v_128;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(rn_0, &v_128, 0), _fx_catch_38);
      fx_str_t slit_6 = FX_MAKE_STR("k-normalization: in the record construction identifier is expected after type check");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&v_128, &slit_6, &v_127, 0), _fx_catch_38);
      FX_THROW(&v_127, false, _fx_catch_38);

   _fx_catch_38: ;
      fx_free_exn(&v_127);

   _fx_endmatch_6: ;
      FX_CHECK_EXN(_fx_catch_45);
      _fx_R9Ast__id_t rn_id_1 = v_118.t0;
      _fx_R9Ast__id_t ctor_1 = v_118.t1;
      FX_COPY_PTR(v_118.t2, &relems_0);
      _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(0, code_0, &__fold_result___7);
      _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_6 = relems_0;
      for (; lst_6; lst_6 = lst_6->tl) {
         _fx_N10Ast__exp_t vi_0 = 0;
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_129 = {0};
         _fx_LN14K_form__atom_t ratoms_1 = 0;
         _fx_LN14K_form__kexp_t code_34 = 0;
         _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t __fold_result___8 = {0};
         _fx_LT2R9Ast__id_tN10Ast__exp_t rinitelems_0 = 0;
         _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t __fold_result___9 = {0};
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_130 = {0};
         _fx_N14K_form__atom_t a_4 = {0};
         _fx_LN14K_form__kexp_t code_35 = 0;
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_131 = {0};
         _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* __pat___0 = &lst_6->hd;
         _fx_R9Ast__id_t ni_0 = __pat___0->t1;
         FX_COPY_PTR(__pat___0->t3, &vi_0);
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___7, &v_129);
         FX_COPY_PTR(v_129.t0, &ratoms_1);
         FX_COPY_PTR(v_129.t1, &code_34);
         _fx_copy_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&_fx_g19K_normalize__None2_, &__fold_result___8);
         FX_COPY_PTR(vcase_13->t1, &rinitelems_0);
         _fx_LT2R9Ast__id_tN10Ast__exp_t lst_7 = rinitelems_0;
         for (; lst_7; lst_7 = lst_7->tl) {
            _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t v_132 = {0};
            _fx_T2R9Ast__id_tN10Ast__exp_t* __pat___1 = &lst_7->hd;
            _fx_R9Ast__id_t nj_1 = __pat___1->t0;
            bool res_6;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&ni_0, &nj_1, &res_6, 0), _fx_catch_39);
            if (res_6) {
               _fx_M11K_normalizeFM4SomeNt6option1T2R9Ast__id_tN10Ast__exp_t1T2R9Ast__id_tN10Ast__exp_t(__pat___1, &v_132);
               _fx_free_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&__fold_result___8);
               _fx_copy_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&v_132, &__fold_result___8);
               FX_BREAK(_fx_catch_39);
            }

         _fx_catch_39: ;
            _fx_free_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&v_132);
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_44);
         }
         _fx_copy_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&__fold_result___8, &__fold_result___9);
         if (__fold_result___9.tag == 2) {
            FX_CALL(
               _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
                  __fold_result___9.u.Some.t1, code_34, false, sc_0, &v_130, 0), _fx_catch_40);

         _fx_catch_40: ;
         }
         else {
            if (FX_REC_VARIANT_TAG(vi_0) == 1) {
               fx_str_t v_133 = {0};
               fx_str_t v_134 = {0};
               fx_str_t v_135 = {0};
               fx_str_t v_136 = {0};
               fx_str_t v_137 = {0};
               fx_exn_t v_138 = {0};
               FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&rn_id_1, &v_133, 0), _fx_catch_41);
               FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_133, &v_134, 0), _fx_catch_41);
               FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&ni_0, &v_135, 0), _fx_catch_41);
               FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_135, &v_136, 0), _fx_catch_41);
               fx_str_t slit_7 = FX_MAKE_STR("there is no explicit initializer for the field \'");
               fx_str_t slit_8 = FX_MAKE_STR(".");
               fx_str_t slit_9 = FX_MAKE_STR("\' nor there is default initializer for it");
               {
                  const fx_str_t strs_0[] = { slit_7, v_134, slit_8, v_136, slit_9 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_0, 5, &v_137), _fx_catch_41);
               }
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&eloc_0, &v_137, &v_138, 0), _fx_catch_41);
               FX_THROW(&v_138, false, _fx_catch_41);

            _fx_catch_41: ;
               fx_free_exn(&v_138);
               FX_FREE_STR(&v_137);
               FX_FREE_STR(&v_136);
               FX_FREE_STR(&v_135);
               FX_FREE_STR(&v_134);
               FX_FREE_STR(&v_133);
            }
            else {
               FX_CALL(
                  _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
                     vi_0, code_34, false, sc_0, &v_130, 0), _fx_catch_42);

            _fx_catch_42: ;
            }
            FX_CHECK_EXN(_fx_catch_43);

         _fx_catch_43: ;
         }
         FX_CHECK_EXN(_fx_catch_44);
         _fx_copy_N14K_form__atom_t(&v_130.t0, &a_4);
         FX_COPY_PTR(v_130.t1, &code_35);
         FX_CALL(_fx_cons_LN14K_form__atom_t(&a_4, ratoms_1, false, &ratoms_1), _fx_catch_44);
         _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(ratoms_1, code_35, &v_131);
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___7);
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_131, &__fold_result___7);

      _fx_catch_44: ;
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_131);
         if (code_35) {
            _fx_free_LN14K_form__kexp_t(&code_35);
         }
         _fx_free_N14K_form__atom_t(&a_4);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_130);
         _fx_free_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&__fold_result___9);
         if (rinitelems_0) {
            _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&rinitelems_0);
         }
         _fx_free_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&__fold_result___8);
         if (code_34) {
            _fx_free_LN14K_form__kexp_t(&code_34);
         }
         if (ratoms_1) {
            _fx_free_LN14K_form__atom_t(&ratoms_1);
         }
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_129);
         if (vi_0) {
            _fx_free_N10Ast__exp_t(&vi_0);
         }
         FX_CHECK_EXN(_fx_catch_45);
      }
      _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___7, &v_120);
      FX_COPY_PTR(v_120.t0, &ratoms_0);
      FX_COPY_PTR(v_120.t1, &code_33);
      bool res_7;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&ctor_1, &_fx_g9Ast__noid, &res_7, 0), _fx_catch_45);
      if (res_7) {
         FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__atom_t1LN14K_form__atom_t(ratoms_0, &v_121, 0), _fx_catch_45);
         FX_CALL(
            _fx_M6K_formFM12KExpMkRecordN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(v_121, &kctx_0,
               &v_122), _fx_catch_45);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_122, code_33, fx_result);
      }
      else {
         FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__atom_t1LN14K_form__atom_t(ratoms_0, &v_123, 0), _fx_catch_45);
         FX_CALL(
            _fx_M6K_formFM8KExpCallN14K_form__kexp_t3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&ctor_1,
               v_123, &kctx_0, &v_124), _fx_catch_45);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_124, code_33, fx_result);
      }

   _fx_catch_45: ;
      if (v_124) {
         _fx_free_N14K_form__kexp_t(&v_124);
      }
      if (v_123) {
         _fx_free_LN14K_form__atom_t(&v_123);
      }
      if (v_122) {
         _fx_free_N14K_form__kexp_t(&v_122);
      }
      if (v_121) {
         _fx_free_LN14K_form__atom_t(&v_121);
      }
      if (code_33) {
         _fx_free_LN14K_form__kexp_t(&code_33);
      }
      if (ratoms_0) {
         _fx_free_LN14K_form__atom_t(&ratoms_0);
      }
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_120);
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___7);
      if (relems_0) {
         _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_0);
      }
      _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_119);
      _fx_free_T3R9Ast__id_tR9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&v_118);
      if (v_117) {
         _fx_free_N10Ast__typ_t(&v_117);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 17) {
      _fx_T2R9Ast__id_tLN14K_form__kexp_t v_139 = {0};
      _fx_LN14K_form__kexp_t code_36 = 0;
      _fx_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t v_140 = {0};
      _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_2 = 0;
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t __fold_result___10 = {0};
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_141 = {0};
      _fx_LN14K_form__atom_t ratoms_2 = 0;
      _fx_LN14K_form__kexp_t code_37 = 0;
      _fx_LN14K_form__atom_t v_142 = 0;
      _fx_N14K_form__kexp_t v_143 = 0;
      _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_14 = &e_0->u.ExpUpdateRecord;
      fx_str_t slit_10 = FX_MAKE_STR("the updated record cannot be a literal");
      FX_CALL(
         _fx_M11K_normalizeFM6exp2idT2R9Ast__id_tLN14K_form__kexp_t5N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_tS(
            vcase_14->t0, code_0, true, sc_0, &slit_10, &v_139, 0), _fx_catch_50);
      _fx_R9Ast__id_t rec_n_0 = v_139.t0;
      FX_COPY_PTR(v_139.t1, &code_36);
      FX_CALL(
         _fx_M13Ast_typecheckFM16get_record_elemsT2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t4Nt6option1R9Ast__id_tN10Ast__typ_tBR10Ast__loc_t(
            &_fx_g19K_normalize__None6_, etyp_0, false, &eloc_0, &v_140, 0), _fx_catch_50);
      FX_COPY_PTR(v_140.t1, &relems_2);
      _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(0, code_36, &__fold_result___10);
      int_ idx_0 = 0;
      _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_8 = relems_2;
      for (; lst_8; lst_8 = lst_8->tl, idx_0 += 1) {
         _fx_N10Ast__typ_t ti_0 = 0;
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_144 = {0};
         _fx_LN14K_form__atom_t ratoms_3 = 0;
         _fx_LN14K_form__kexp_t code_38 = 0;
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_145 = {0};
         fx_exn_t exn_1 = {0};
         _fx_N14K_form__atom_t a_5 = {0};
         _fx_LN14K_form__kexp_t code_39 = 0;
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_146 = {0};
         _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* __pat___2 = &lst_8->hd;
         _fx_R9Ast__id_t ni_1 = __pat___2->t1;
         FX_COPY_PTR(__pat___2->t2, &ti_0);
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___10, &v_144);
         FX_COPY_PTR(v_144.t0, &ratoms_3);
         FX_COPY_PTR(v_144.t1, &code_38);
         _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t __fold_result___11 = {0};
         _fx_LT2R9Ast__id_tN10Ast__exp_t new_elems_0 = 0;
         _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t __fold_result___12 = {0};
         _fx_T2R9Ast__id_tN10Ast__exp_t v_147 = {0};
         _fx_N10Ast__exp_t ej_0 = 0;
         _fx_copy_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&_fx_g19K_normalize__None2_, &__fold_result___11);
         FX_COPY_PTR(vcase_14->t1, &new_elems_0);
         _fx_LT2R9Ast__id_tN10Ast__exp_t lst_9 = new_elems_0;
         for (; lst_9; lst_9 = lst_9->tl) {
            _fx_Nt6option1T2R9Ast__id_tN10Ast__exp_t v_148 = {0};
            _fx_T2R9Ast__id_tN10Ast__exp_t* __pat___3 = &lst_9->hd;
            _fx_R9Ast__id_t nj_2 = __pat___3->t0;
            bool res_8;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&ni_1, &nj_2, &res_8, 0), _fx_catch_46);
            if (res_8) {
               _fx_M11K_normalizeFM4SomeNt6option1T2R9Ast__id_tN10Ast__exp_t1T2R9Ast__id_tN10Ast__exp_t(__pat___3, &v_148);
               _fx_free_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&__fold_result___11);
               _fx_copy_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&v_148, &__fold_result___11);
               FX_BREAK(_fx_catch_46);
            }

         _fx_catch_46: ;
            _fx_free_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&v_148);
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_47);
         }
         _fx_copy_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&__fold_result___11, &__fold_result___12);
         if (__fold_result___12.tag == 2) {
            _fx_copy_T2R9Ast__id_tN10Ast__exp_t(&__fold_result___12.u.Some, &v_147);
         }
         else {
            FX_FAST_THROW(FX_EXN_NotFoundError, _fx_catch_47);
         }
         FX_CHECK_EXN(_fx_catch_47);
         FX_COPY_PTR(v_147.t1, &ej_0);
         FX_CALL(
            _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               ej_0, code_38, false, sc_0, &v_145, 0), _fx_catch_47);

      _fx_catch_47: ;
         _fx_free_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&__fold_result___11);
         if (new_elems_0) {
            _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&new_elems_0);
         }
         _fx_free_Nt6option1T2R9Ast__id_tN10Ast__exp_t(&__fold_result___12);
         _fx_free_T2R9Ast__id_tN10Ast__exp_t(&v_147);
         if (ej_0) {
            _fx_free_N10Ast__exp_t(&ej_0);
         }
         if (fx_status < 0) {
            fx_exn_get_and_reset(fx_status, &exn_1);
            fx_status = 0;
            _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_145);
            if (exn_1.tag == FX_EXN_NotFoundError) {
               _fx_N14K_form__ktyp_t ti__0 = 0;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_149 = {0};
               _fx_N14K_form__kexp_t get_ni_0 = 0;
               _fx_R16Ast__val_flags_t v_150 = {0};
               _fx_Nt6option1N14K_form__kexp_t v_151 = {0};
               _fx_LN14K_form__kexp_t code_40 = 0;
               _fx_N14K_form__atom_t v_152 = {0};
               _fx_R9Ast__id_t ni__0;
               FX_CALL(_fx_M6K_formFM7dup_idkR9Ast__id_t2iR9Ast__id_t(km_idx_0, &ni_1, &ni__0, 0), _fx_catch_48);
               FX_CALL(_fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(ti_0, &eloc_0, &ti__0, 0),
                  _fx_catch_48);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ti__0, &eloc_0, &v_149);
               FX_CALL(
                  _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&rec_n_0, idx_0, &v_149,
                     &get_ni_0), _fx_catch_48);
               FX_CALL(_fx_M3AstFM21default_tempref_flagsRM11val_flags_t0(&v_150, 0), _fx_catch_48);
               _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(get_ni_0, &v_151);
               FX_CALL(
                  _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
                     &ni__0, ti__0, &v_150, &v_151, code_38, &eloc_0, &code_40, 0), _fx_catch_48);
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&ni__0, &v_152);
               _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(&v_152, code_40, &v_145);

            _fx_catch_48: ;
               _fx_free_N14K_form__atom_t(&v_152);
               if (code_40) {
                  _fx_free_LN14K_form__kexp_t(&code_40);
               }
               _fx_free_Nt6option1N14K_form__kexp_t(&v_151);
               _fx_free_R16Ast__val_flags_t(&v_150);
               if (get_ni_0) {
                  _fx_free_N14K_form__kexp_t(&get_ni_0);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_149);
               if (ti__0) {
                  _fx_free_N14K_form__ktyp_t(&ti__0);
               }
            }
            else {
               FX_RETHROW(&exn_1, _fx_catch_49);
            }
            FX_CHECK_EXN(_fx_catch_49);
         }
         _fx_copy_N14K_form__atom_t(&v_145.t0, &a_5);
         FX_COPY_PTR(v_145.t1, &code_39);
         FX_CALL(_fx_cons_LN14K_form__atom_t(&a_5, ratoms_3, false, &ratoms_3), _fx_catch_49);
         _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(ratoms_3, code_39, &v_146);
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___10);
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_146, &__fold_result___10);

      _fx_catch_49: ;
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_146);
         if (code_39) {
            _fx_free_LN14K_form__kexp_t(&code_39);
         }
         _fx_free_N14K_form__atom_t(&a_5);
         fx_free_exn(&exn_1);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_145);
         if (code_38) {
            _fx_free_LN14K_form__kexp_t(&code_38);
         }
         if (ratoms_3) {
            _fx_free_LN14K_form__atom_t(&ratoms_3);
         }
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_144);
         if (ti_0) {
            _fx_free_N10Ast__typ_t(&ti_0);
         }
         FX_CHECK_EXN(_fx_catch_50);
      }
      _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___10, &v_141);
      FX_COPY_PTR(v_141.t0, &ratoms_2);
      FX_COPY_PTR(v_141.t1, &code_37);
      FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__atom_t1LN14K_form__atom_t(ratoms_2, &v_142, 0), _fx_catch_50);
      FX_CALL(
         _fx_M6K_formFM12KExpMkRecordN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(v_142, &kctx_0,
            &v_143), _fx_catch_50);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_143, code_37, fx_result);

   _fx_catch_50: ;
      if (v_143) {
         _fx_free_N14K_form__kexp_t(&v_143);
      }
      if (v_142) {
         _fx_free_LN14K_form__atom_t(&v_142);
      }
      if (code_37) {
         _fx_free_LN14K_form__kexp_t(&code_37);
      }
      if (ratoms_2) {
         _fx_free_LN14K_form__atom_t(&ratoms_2);
      }
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_141);
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___10);
      if (relems_2) {
         _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_2);
      }
      _fx_free_T2R9Ast__id_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&v_140);
      if (code_36) {
         _fx_free_LN14K_form__kexp_t(&code_36);
      }
      _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_139);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 18) {
      _fx_LN10Ast__exp_t v_153 = 0;
      _fx_T2LN10Ast__exp_tNt6option1N10Ast__exp_t v_154 = {0};
      _fx_LN10Ast__exp_t args_7 = 0;
      _fx_Nt6option1N10Ast__exp_t kwarg_opt_0 = 0;
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t __fold_result___13 = {0};
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_155 = {0};
      _fx_LN14K_form__atom_t args_8 = 0;
      _fx_LN14K_form__kexp_t code_41 = 0;
      _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_156 = {0};
      _fx_LN14K_form__atom_t args_9 = 0;
      _fx_LN14K_form__kexp_t code_42 = 0;
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_157 = {0};
      _fx_N14K_form__kexp_t f_exp_0 = 0;
      _fx_LN14K_form__kexp_t code_43 = 0;
      _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_15 = &e_0->u.ExpCall;
      _fx_LN10Ast__exp_t args_10 = vcase_15->t1;
      FX_CALL(_fx_M11K_normalizeFM3revLN10Ast__exp_t1LN10Ast__exp_t(args_10, &v_153, 0), _fx_catch_61);
      if (v_153 != 0) {
         _fx_N10Ast__exp_t mkrec_0 = v_153->hd;
         if (FX_REC_VARIANT_TAG(mkrec_0) == 16) {
            if (FX_REC_VARIANT_TAG(mkrec_0->u.ExpMkRecord.t0) == 1) {
               _fx_LN10Ast__exp_t v_158 = 0;
               _fx_Nt6option1N10Ast__exp_t v_159 = 0;
               FX_CALL(_fx_M11K_normalizeFM3revLN10Ast__exp_t1LN10Ast__exp_t(v_153->tl, &v_158, 0), _fx_catch_51);
               FX_CALL(_fx_M11K_normalizeFM4SomeNt6option1N10Ast__exp_t1N10Ast__exp_t(mkrec_0, &v_159), _fx_catch_51);
               _fx_make_T2LN10Ast__exp_tNt6option1N10Ast__exp_t(v_158, v_159, &v_154);

            _fx_catch_51: ;
               if (v_159) {
                  _fx_free_Nt6option1N10Ast__exp_t(&v_159);
               }
               if (v_158) {
                  _fx_free_LN10Ast__exp_t(&v_158);
               }
               goto _fx_endmatch_7;
            }
         }
      }
      _fx_make_T2LN10Ast__exp_tNt6option1N10Ast__exp_t(args_10, _fx_g19K_normalize__None7_, &v_154);

   _fx_endmatch_7: ;
      FX_CHECK_EXN(_fx_catch_61);
      FX_COPY_PTR(v_154.t0, &args_7);
      FX_COPY_PTR(v_154.t1, &kwarg_opt_0);
      _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(0, code_0, &__fold_result___13);
      _fx_LN10Ast__exp_t lst_10 = args_7;
      for (; lst_10; lst_10 = lst_10->tl) {
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_160 = {0};
         _fx_LN14K_form__atom_t args_11 = 0;
         _fx_LN14K_form__kexp_t code_44 = 0;
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_161 = {0};
         _fx_N14K_form__atom_t ai_2 = {0};
         _fx_LN14K_form__kexp_t code_45 = 0;
         _fx_T2LN14K_form__atom_tLN14K_form__kexp_t v_162 = {0};
         _fx_N10Ast__exp_t ei_2 = lst_10->hd;
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___13, &v_160);
         FX_COPY_PTR(v_160.t0, &args_11);
         FX_COPY_PTR(v_160.t1, &code_44);
         FX_CALL(
            _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               ei_2, code_44, false, sc_0, &v_161, 0), _fx_catch_52);
         _fx_copy_N14K_form__atom_t(&v_161.t0, &ai_2);
         FX_COPY_PTR(v_161.t1, &code_45);
         FX_CALL(_fx_cons_LN14K_form__atom_t(&ai_2, args_11, false, &args_11), _fx_catch_52);
         _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(args_11, code_45, &v_162);
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___13);
         _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_162, &__fold_result___13);

      _fx_catch_52: ;
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_162);
         if (code_45) {
            _fx_free_LN14K_form__kexp_t(&code_45);
         }
         _fx_free_N14K_form__atom_t(&ai_2);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_161);
         if (code_44) {
            _fx_free_LN14K_form__kexp_t(&code_44);
         }
         if (args_11) {
            _fx_free_LN14K_form__atom_t(&args_11);
         }
         _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_160);
         FX_CHECK_EXN(_fx_catch_61);
      }
      _fx_copy_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___13, &v_155);
      FX_COPY_PTR(v_155.t0, &args_8);
      FX_COPY_PTR(v_155.t1, &code_41);
      if ((kwarg_opt_0 != 0) + 1 == 2) {
         _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_163 = {0};
         _fx_N14K_form__kexp_t ke_0 = 0;
         _fx_LN14K_form__kexp_t code_46 = 0;
         _fx_N10Ast__exp_t e_6 = kwarg_opt_0->u.Some;
         FX_CALL(
            _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               e_6, code_41, false, sc_0, &v_163, 0), _fx_catch_55);
         FX_COPY_PTR(v_163.t0, &ke_0);
         FX_COPY_PTR(v_163.t1, &code_46);
         if (FX_REC_VARIANT_TAG(ke_0) == 15) {
            _fx_LN14K_form__atom_t v_164 = 0;
            _fx_LN14K_form__atom_t v_165 = 0;
            FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__atom_t1LN14K_form__atom_t(args_8, &v_164, 0), _fx_catch_53);
            FX_CALL(
               _fx_M11K_normalizeFM7__add__LN14K_form__atom_t2LN14K_form__atom_tLN14K_form__atom_t(v_164,
                  ke_0->u.KExpMkRecord.t0, &v_165, 0), _fx_catch_53);
            _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(v_165, code_46, &v_156);

         _fx_catch_53: ;
            if (v_165) {
               _fx_free_LN14K_form__atom_t(&v_165);
            }
            if (v_164) {
               _fx_free_LN14K_form__atom_t(&v_164);
            }
         }
         else {
            fx_exn_t v_166 = {0};
            _fx_R10Ast__loc_t v_167;
            FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_6, &v_167, 0), _fx_catch_54);
            fx_str_t slit_11 = FX_MAKE_STR("the expression should convert to KExpMkRecord()");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&v_167, &slit_11, &v_166, 0), _fx_catch_54);
            FX_THROW(&v_166, false, _fx_catch_54);

         _fx_catch_54: ;
            fx_free_exn(&v_166);
         }
         FX_CHECK_EXN(_fx_catch_55);

      _fx_catch_55: ;
         if (code_46) {
            _fx_free_LN14K_form__kexp_t(&code_46);
         }
         if (ke_0) {
            _fx_free_N14K_form__kexp_t(&ke_0);
         }
         _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_163);
      }
      else {
         _fx_LN14K_form__atom_t v_168 = 0;
         FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__atom_t1LN14K_form__atom_t(args_8, &v_168, 0), _fx_catch_56);
         _fx_make_T2LN14K_form__atom_tLN14K_form__kexp_t(v_168, code_41, &v_156);

      _fx_catch_56: ;
         if (v_168) {
            _fx_free_LN14K_form__atom_t(&v_168);
         }
      }
      FX_CHECK_EXN(_fx_catch_61);
      FX_COPY_PTR(v_156.t0, &args_9);
      FX_COPY_PTR(v_156.t1, &code_42);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            vcase_15->t0, code_42, false, sc_0, &v_157, 0), _fx_catch_61);
      FX_COPY_PTR(v_157.t0, &f_exp_0);
      FX_COPY_PTR(v_157.t1, &code_43);
      if (FX_REC_VARIANT_TAG(f_exp_0) == 20) {
         _fx_N14K_form__ktyp_t t_0 = 0;
         _fx_Nt6option1rR23K_form__kdefinterface_t v_169 = {0};
         _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* vcase_16 = &f_exp_0->u.KExpMem;
         _fx_R10Ast__loc_t* f_loc_0 = &vcase_16->t2.t1;
         _fx_R9Ast__id_t* obj_0 = &vcase_16->t0;
         FX_CALL(_fx_M6K_formFM12get_idk_ktypN14K_form__ktyp_t2R9Ast__id_tR10Ast__loc_t(obj_0, f_loc_0, &t_0, 0), _fx_catch_59);
         FX_CALL(
            _fx_M6K_formFM18get_kinterface_optNt6option1rRM15kdefinterface_t2N14K_form__ktyp_tR10Ast__loc_t(t_0, f_loc_0,
               &v_169, 0), _fx_catch_59);
         if (v_169.tag == 2) {
            _fx_N14K_form__kexp_t v_170 = 0;
            FX_CALL(
               _fx_M6K_formFM9KExpICallN14K_form__kexp_t4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(obj_0,
                  vcase_16->t1, args_9, &kctx_0, &v_170), _fx_catch_57);
            _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_170, code_43, fx_result);

         _fx_catch_57: ;
            if (v_170) {
               _fx_free_N14K_form__kexp_t(&v_170);
            }
         }
         else {
            _fx_T2R9Ast__id_tLN14K_form__kexp_t v_171 = {0};
            _fx_LN14K_form__kexp_t code_47 = 0;
            _fx_N14K_form__kexp_t v_172 = 0;
            fx_str_t slit_12 = FX_MAKE_STR("f");
            fx_str_t slit_13 = FX_MAKE_STR("cannot reduce obj.idx to an id (?!)");
            FX_CALL(
               _fx_M6K_formFM7kexp2idT2R9Ast__id_tLN14K_form__kexp_t6iSN14K_form__kexp_tBLN14K_form__kexp_tS(km_idx_0, &slit_12,
                  f_exp_0, true, code_43, &slit_13, &v_171, 0), _fx_catch_58);
            _fx_R9Ast__id_t f_id_0 = v_171.t0;
            FX_COPY_PTR(v_171.t1, &code_47);
            FX_CALL(
               _fx_M6K_formFM8KExpCallN14K_form__kexp_t3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&f_id_0,
                  args_9, &kctx_0, &v_172), _fx_catch_58);
            _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_172, code_47, fx_result);

         _fx_catch_58: ;
            if (v_172) {
               _fx_free_N14K_form__kexp_t(&v_172);
            }
            if (code_47) {
               _fx_free_LN14K_form__kexp_t(&code_47);
            }
            _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_171);
         }
         FX_CHECK_EXN(_fx_catch_59);

      _fx_catch_59: ;
         _fx_free_Nt6option1rR23K_form__kdefinterface_t(&v_169);
         if (t_0) {
            _fx_free_N14K_form__ktyp_t(&t_0);
         }
      }
      else {
         _fx_T2R9Ast__id_tLN14K_form__kexp_t v_173 = {0};
         _fx_LN14K_form__kexp_t code_48 = 0;
         _fx_N14K_form__kexp_t v_174 = 0;
         fx_str_t slit_14 = FX_MAKE_STR("f");
         fx_str_t slit_15 = FX_MAKE_STR("cannot reduce function expression to an id");
         FX_CALL(
            _fx_M6K_formFM7kexp2idT2R9Ast__id_tLN14K_form__kexp_t6iSN14K_form__kexp_tBLN14K_form__kexp_tS(km_idx_0, &slit_14,
               f_exp_0, true, code_43, &slit_15, &v_173, 0), _fx_catch_60);
         _fx_R9Ast__id_t f_id_1 = v_173.t0;
         FX_COPY_PTR(v_173.t1, &code_48);
         FX_CALL(
            _fx_M6K_formFM8KExpCallN14K_form__kexp_t3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&f_id_1,
               args_9, &kctx_0, &v_174), _fx_catch_60);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_174, code_48, fx_result);

      _fx_catch_60: ;
         if (v_174) {
            _fx_free_N14K_form__kexp_t(&v_174);
         }
         if (code_48) {
            _fx_free_LN14K_form__kexp_t(&code_48);
         }
         _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_173);
      }
      FX_CHECK_EXN(_fx_catch_61);

   _fx_catch_61: ;
      if (code_43) {
         _fx_free_LN14K_form__kexp_t(&code_43);
      }
      if (f_exp_0) {
         _fx_free_N14K_form__kexp_t(&f_exp_0);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_157);
      if (code_42) {
         _fx_free_LN14K_form__kexp_t(&code_42);
      }
      if (args_9) {
         _fx_free_LN14K_form__atom_t(&args_9);
      }
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_156);
      if (code_41) {
         _fx_free_LN14K_form__kexp_t(&code_41);
      }
      if (args_8) {
         _fx_free_LN14K_form__atom_t(&args_8);
      }
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&v_155);
      _fx_free_T2LN14K_form__atom_tLN14K_form__kexp_t(&__fold_result___13);
      if (kwarg_opt_0) {
         _fx_free_Nt6option1N10Ast__exp_t(&kwarg_opt_0);
      }
      if (args_7) {
         _fx_free_LN10Ast__exp_t(&args_7);
      }
      _fx_free_T2LN10Ast__exp_tNt6option1N10Ast__exp_t(&v_154);
      if (v_153) {
         _fx_free_LN10Ast__exp_t(&v_153);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 22) {
      _fx_T2R9Ast__id_tLN14K_form__kexp_t v_175 = {0};
      _fx_LN14K_form__kexp_t code_49 = 0;
      _fx_N14K_form__kexp_t v_176 = 0;
      fx_str_t slit_16 = FX_MAKE_STR("a literal cannot be thrown as exception");
      FX_CALL(
         _fx_M11K_normalizeFM6exp2idT2R9Ast__id_tLN14K_form__kexp_t5N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_tS(
            e_0->u.ExpThrow.t0, code_0, false, sc_0, &slit_16, &v_175, 0), _fx_catch_62);
      _fx_R9Ast__id_t a_id_1 = v_175.t0;
      FX_COPY_PTR(v_175.t1, &code_49);
      FX_CALL(_fx_M6K_formFM9KExpThrowN14K_form__kexp_t3R9Ast__id_tBR10Ast__loc_t(&a_id_1, false, &eloc_0, &v_176),
         _fx_catch_62);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_176, code_49, fx_result);

   _fx_catch_62: ;
      if (v_176) {
         _fx_free_N14K_form__kexp_t(&v_176);
      }
      if (code_49) {
         _fx_free_LN14K_form__kexp_t(&code_49);
      }
      _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_175);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 23) {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_177 = {0};
      _fx_N14K_form__atom_t c_0 = {0};
      _fx_LN14K_form__kexp_t code_50 = 0;
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_178 = {0};
      _fx_N14K_form__kexp_t e2_6 = 0;
      _fx_LN14K_form__kexp_t code2_2 = 0;
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_179 = {0};
      _fx_N14K_form__kexp_t e3_0 = 0;
      _fx_LN14K_form__kexp_t code3_0 = 0;
      _fx_LN14K_form__kexp_t v_180 = 0;
      _fx_N14K_form__kexp_t if_then_0 = 0;
      _fx_LN14K_form__kexp_t v_181 = 0;
      _fx_N14K_form__kexp_t if_else_0 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_182 = {0};
      _fx_N14K_form__kexp_t v_183 = 0;
      _fx_N14K_form__kexp_t v_184 = 0;
      _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_17 = &e_0->u.ExpIf;
      _fx_N10Ast__exp_t e3_1 = vcase_17->t2;
      _fx_N10Ast__exp_t e2_7 = vcase_17->t1;
      _fx_N10Ast__exp_t e1_3 = vcase_17->t0;
      FX_CALL(
         _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e1_3, code_0, false, sc_0, &v_177, 0), _fx_catch_63);
      _fx_copy_N14K_form__atom_t(&v_177.t0, &c_0);
      FX_COPY_PTR(v_177.t1, &code_50);
      _fx_R10Ast__loc_t loc1_0;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e1_3, &loc1_0, 0), _fx_catch_63);
      _fx_R10Ast__loc_t loc2_0;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e2_7, &loc2_0, 0), _fx_catch_63);
      _fx_R10Ast__loc_t loc3_0;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e3_1, &loc3_0, 0), _fx_catch_63);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e2_7, 0, false, sc_0, &v_178, 0), _fx_catch_63);
      FX_COPY_PTR(v_178.t0, &e2_6);
      FX_COPY_PTR(v_178.t1, &code2_2);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e3_1, 0, false, sc_0, &v_179, 0), _fx_catch_63);
      FX_COPY_PTR(v_179.t0, &e3_0);
      FX_COPY_PTR(v_179.t1, &code3_0);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(e2_6, code2_2, true, &v_180), _fx_catch_63);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_180, &loc2_0, &if_then_0, 0),
         _fx_catch_63);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(e3_0, code3_0, true, &v_181), _fx_catch_63);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_181, &loc3_0, &if_else_0, 0),
         _fx_catch_63);
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypBool, &loc1_0, &v_182);
      FX_CALL(_fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&c_0, &v_182, &v_183),
         _fx_catch_63);
      FX_CALL(
         _fx_M6K_formFM6KExpIfN14K_form__kexp_t4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
            v_183, if_then_0, if_else_0, &kctx_0, &v_184), _fx_catch_63);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_184, code_50, fx_result);

   _fx_catch_63: ;
      if (v_184) {
         _fx_free_N14K_form__kexp_t(&v_184);
      }
      if (v_183) {
         _fx_free_N14K_form__kexp_t(&v_183);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_182);
      if (if_else_0) {
         _fx_free_N14K_form__kexp_t(&if_else_0);
      }
      if (v_181) {
         _fx_free_LN14K_form__kexp_t(&v_181);
      }
      if (if_then_0) {
         _fx_free_N14K_form__kexp_t(&if_then_0);
      }
      if (v_180) {
         _fx_free_LN14K_form__kexp_t(&v_180);
      }
      if (code3_0) {
         _fx_free_LN14K_form__kexp_t(&code3_0);
      }
      if (e3_0) {
         _fx_free_N14K_form__kexp_t(&e3_0);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_179);
      if (code2_2) {
         _fx_free_LN14K_form__kexp_t(&code2_2);
      }
      if (e2_6) {
         _fx_free_N14K_form__kexp_t(&e2_6);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_178);
      if (code_50) {
         _fx_free_LN14K_form__kexp_t(&code_50);
      }
      _fx_free_N14K_form__atom_t(&c_0);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_177);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 24) {
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_185 = {0};
      _fx_N14K_form__kexp_t e1_4 = 0;
      _fx_LN14K_form__kexp_t code1_1 = 0;
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_186 = {0};
      _fx_N14K_form__kexp_t e2_8 = 0;
      _fx_LN14K_form__kexp_t code2_3 = 0;
      _fx_LN14K_form__kexp_t v_187 = 0;
      _fx_N14K_form__kexp_t c_1 = 0;
      _fx_LN14K_form__kexp_t v_188 = 0;
      _fx_N14K_form__kexp_t body_0 = 0;
      _fx_N14K_form__kexp_t v_189 = 0;
      _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* vcase_18 = &e_0->u.ExpWhile;
      _fx_N10Ast__exp_t e2_9 = vcase_18->t1;
      _fx_N10Ast__exp_t e1_5 = vcase_18->t0;
      _fx_R10Ast__loc_t loc1_1;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e1_5, &loc1_1, 0), _fx_catch_64);
      _fx_R10Ast__loc_t loc2_1;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e2_9, &loc2_1, 0), _fx_catch_64);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e1_5, 0, false, sc_0, &v_185, 0), _fx_catch_64);
      FX_COPY_PTR(v_185.t0, &e1_4);
      FX_COPY_PTR(v_185.t1, &code1_1);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e2_9, 0, false, sc_0, &v_186, 0), _fx_catch_64);
      FX_COPY_PTR(v_186.t0, &e2_8);
      FX_COPY_PTR(v_186.t1, &code2_3);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(e1_4, code1_1, true, &v_187), _fx_catch_64);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_187, &loc1_1, &c_1, 0),
         _fx_catch_64);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(e2_8, code2_3, true, &v_188), _fx_catch_64);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_188, &loc2_1, &body_0, 0),
         _fx_catch_64);
      FX_CALL(
         _fx_M6K_formFM9KExpWhileN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(c_1, body_0, &eloc_0,
            &v_189), _fx_catch_64);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_189, code_0, fx_result);

   _fx_catch_64: ;
      if (v_189) {
         _fx_free_N14K_form__kexp_t(&v_189);
      }
      if (body_0) {
         _fx_free_N14K_form__kexp_t(&body_0);
      }
      if (v_188) {
         _fx_free_LN14K_form__kexp_t(&v_188);
      }
      if (c_1) {
         _fx_free_N14K_form__kexp_t(&c_1);
      }
      if (v_187) {
         _fx_free_LN14K_form__kexp_t(&v_187);
      }
      if (code2_3) {
         _fx_free_LN14K_form__kexp_t(&code2_3);
      }
      if (e2_8) {
         _fx_free_N14K_form__kexp_t(&e2_8);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_186);
      if (code1_1) {
         _fx_free_LN14K_form__kexp_t(&code1_1);
      }
      if (e1_4) {
         _fx_free_N14K_form__kexp_t(&e1_4);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_185);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 25) {
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_190 = {0};
      _fx_N14K_form__kexp_t e1_6 = 0;
      _fx_LN14K_form__kexp_t code1_2 = 0;
      _fx_LN14K_form__kexp_t v_191 = 0;
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_192 = {0};
      _fx_N14K_form__kexp_t e2_10 = 0;
      _fx_LN14K_form__kexp_t code2_4 = 0;
      _fx_N14K_form__kexp_t body_1 = 0;
      _fx_N14K_form__kexp_t v_193 = 0;
      _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* vcase_19 = &e_0->u.ExpDoWhile;
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            vcase_19->t0, 0, false, sc_0, &v_190, 0), _fx_catch_65);
      FX_COPY_PTR(v_190.t0, &e1_6);
      FX_COPY_PTR(v_190.t1, &code1_2);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(e1_6, code1_2, true, &v_191), _fx_catch_65);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            vcase_19->t1, v_191, false, sc_0, &v_192, 0), _fx_catch_65);
      FX_COPY_PTR(v_192.t0, &e2_10);
      FX_COPY_PTR(v_192.t1, &code2_4);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(code2_4, &eloc_0, &body_1, 0),
         _fx_catch_65);
      FX_CALL(
         _fx_M6K_formFM11KExpDoWhileN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(body_1, e2_10, &eloc_0,
            &v_193), _fx_catch_65);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_193, code_0, fx_result);

   _fx_catch_65: ;
      if (v_193) {
         _fx_free_N14K_form__kexp_t(&v_193);
      }
      if (body_1) {
         _fx_free_N14K_form__kexp_t(&body_1);
      }
      if (code2_4) {
         _fx_free_LN14K_form__kexp_t(&code2_4);
      }
      if (e2_10) {
         _fx_free_N14K_form__kexp_t(&e2_10);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_192);
      if (v_191) {
         _fx_free_LN14K_form__kexp_t(&v_191);
      }
      if (code1_2) {
         _fx_free_LN14K_form__kexp_t(&code1_2);
      }
      if (e1_6) {
         _fx_free_N14K_form__kexp_t(&e1_6);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_190);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 26) {
      _fx_LN12Ast__scope_t body_sc_0 = 0;
      _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t v_194 = {0};
      _fx_LT2R9Ast__id_tN13K_form__dom_t idom_list_0 = 0;
      _fx_LR9Ast__id_t at_ids_0 = 0;
      _fx_LN14K_form__kexp_t code_51 = 0;
      _fx_LN14K_form__kexp_t body_code_0 = 0;
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_195 = {0};
      _fx_N14K_form__kexp_t last_e_0 = 0;
      _fx_LN14K_form__kexp_t body_code_1 = 0;
      _fx_LN14K_form__kexp_t v_196 = 0;
      _fx_N14K_form__kexp_t body_kexp_0 = 0;
      _fx_N14K_form__kexp_t v_197 = 0;
      _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* vcase_20 = &e_0->u.ExpFor;
      _fx_N10Ast__exp_t body_2 = vcase_20->t2;
      _fx_N12Ast__scope_t v_198;
      FX_CALL(_fx_M3AstFM15new_block_scopeN12Ast__scope_t1i(km_idx_0, &v_198, 0), _fx_catch_66);
      FX_CALL(_fx_cons_LN12Ast__scope_t(&v_198, sc_0, true, &body_sc_0), _fx_catch_66);
      FX_CALL(
         _fx_M11K_normalizeFM13transform_forT4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t7LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tLN14K_form__kexp_tLN12Ast__scope_tLN12Ast__scope_tR10Ast__loc_ti(
            vcase_20->t0, vcase_20->t1, code_0, sc_0, body_sc_0, &eloc_0, km_idx_0, &v_194, 0), _fx_catch_66);
      FX_COPY_PTR(v_194.t0, &idom_list_0);
      FX_COPY_PTR(v_194.t1, &at_ids_0);
      FX_COPY_PTR(v_194.t2, &code_51);
      FX_COPY_PTR(v_194.t3, &body_code_0);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            body_2, body_code_0, false, body_sc_0, &v_195, 0), _fx_catch_66);
      FX_COPY_PTR(v_195.t0, &last_e_0);
      FX_COPY_PTR(v_195.t1, &body_code_1);
      _fx_R10Ast__loc_t bloc_0;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(body_2, &bloc_0, 0), _fx_catch_66);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(last_e_0, body_code_1, true, &v_196), _fx_catch_66);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_196, &bloc_0, &body_kexp_0, 0),
         _fx_catch_66);
      FX_CALL(
         _fx_M6K_formFM7KExpForN14K_form__kexp_t5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
            idom_list_0, at_ids_0, body_kexp_0, &vcase_20->t3, &eloc_0, &v_197), _fx_catch_66);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_197, code_51, fx_result);

   _fx_catch_66: ;
      if (v_197) {
         _fx_free_N14K_form__kexp_t(&v_197);
      }
      if (body_kexp_0) {
         _fx_free_N14K_form__kexp_t(&body_kexp_0);
      }
      if (v_196) {
         _fx_free_LN14K_form__kexp_t(&v_196);
      }
      if (body_code_1) {
         _fx_free_LN14K_form__kexp_t(&body_code_1);
      }
      if (last_e_0) {
         _fx_free_N14K_form__kexp_t(&last_e_0);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_195);
      if (body_code_0) {
         _fx_free_LN14K_form__kexp_t(&body_code_0);
      }
      if (code_51) {
         _fx_free_LN14K_form__kexp_t(&code_51);
      }
      FX_FREE_LIST_SIMPLE(&at_ids_0);
      if (idom_list_0) {
         _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&idom_list_0);
      }
      _fx_free_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t(&v_194);
      FX_FREE_LIST_SIMPLE(&body_sc_0);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 27) {
      _fx_LN12Ast__scope_t body_sc_1 = 0;
      _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t __fold_result___14 = {0};
      _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t pew_ll_0 = 0;
      _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t v_199 = {0};
      _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t pre_idom_ll_0 = 0;
      _fx_LN14K_form__kexp_t body_code_2 = 0;
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_200 = {0};
      _fx_N14K_form__kexp_t last_e_1 = 0;
      _fx_LN14K_form__kexp_t body_code_3 = 0;
      _fx_LN14K_form__kexp_t v_201 = 0;
      _fx_N14K_form__kexp_t body_kexp_1 = 0;
      _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t v_202 = 0;
      _fx_N14K_form__kexp_t v_203 = 0;
      _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t*
         vcase_21 = &e_0->u.ExpMap;
      _fx_N10Ast__exp_t body_3 = vcase_21->t1;
      _fx_N12Ast__scope_t v_204;
      FX_CALL(_fx_M3AstFM15new_block_scopeN12Ast__scope_t1i(km_idx_0, &v_204, 0), _fx_catch_68);
      FX_CALL(_fx_cons_LN12Ast__scope_t(&v_204, sc_0, true, &body_sc_1), _fx_catch_68);
      _fx_make_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(0, 0, &__fold_result___14);
      FX_COPY_PTR(vcase_21->t0, &pew_ll_0);
      _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t lst_11 = pew_ll_0;
      for (; lst_11; lst_11 = lst_11->tl) {
         _fx_LT2N10Ast__pat_tN10Ast__exp_t pe_l_0 = 0;
         _fx_N10Ast__pat_t idx_pat_0 = 0;
         _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t v_205 = {0};
         _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t pre_idom_ll_1 = 0;
         _fx_LN14K_form__kexp_t prev_body_code_0 = 0;
         _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t v_206 = {0};
         _fx_LT2R9Ast__id_tN13K_form__dom_t idom_list_1 = 0;
         _fx_LR9Ast__id_t at_ids_1 = 0;
         _fx_LN14K_form__kexp_t pre_code_0 = 0;
         _fx_LN14K_form__kexp_t body_code_4 = 0;
         _fx_N14K_form__kexp_t pre_exp_0 = 0;
         _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t v_207 = {0};
         _fx_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t v_208 = {0};
         _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* __pat___4 = &lst_11->hd;
         FX_COPY_PTR(__pat___4->t0, &pe_l_0);
         FX_COPY_PTR(__pat___4->t1, &idx_pat_0);
         _fx_copy_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(&__fold_result___14,
            &v_205);
         FX_COPY_PTR(v_205.t0, &pre_idom_ll_1);
         FX_COPY_PTR(v_205.t1, &prev_body_code_0);
         FX_CALL(
            _fx_M11K_normalizeFM13transform_forT4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t7LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tLN14K_form__kexp_tLN12Ast__scope_tLN12Ast__scope_tR10Ast__loc_ti(
               pe_l_0, idx_pat_0, prev_body_code_0, sc_0, body_sc_1, &eloc_0, km_idx_0, &v_206, 0), _fx_catch_67);
         FX_COPY_PTR(v_206.t0, &idom_list_1);
         FX_COPY_PTR(v_206.t1, &at_ids_1);
         FX_COPY_PTR(v_206.t2, &pre_code_0);
         FX_COPY_PTR(v_206.t3, &body_code_4);
         FX_CALL(
            _fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(pre_code_0, &eloc_0, &pre_exp_0, 0),
            _fx_catch_67);
         _fx_make_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(pre_exp_0, idom_list_1, at_ids_1, &v_207);
         FX_CALL(
            _fx_cons_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&v_207, pre_idom_ll_1, false,
               &pre_idom_ll_1), _fx_catch_67);
         _fx_make_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(pre_idom_ll_1, body_code_4,
            &v_208);
         _fx_free_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(&__fold_result___14);
         _fx_copy_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(&v_208,
            &__fold_result___14);

      _fx_catch_67: ;
         _fx_free_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(&v_208);
         _fx_free_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&v_207);
         if (pre_exp_0) {
            _fx_free_N14K_form__kexp_t(&pre_exp_0);
         }
         if (body_code_4) {
            _fx_free_LN14K_form__kexp_t(&body_code_4);
         }
         if (pre_code_0) {
            _fx_free_LN14K_form__kexp_t(&pre_code_0);
         }
         FX_FREE_LIST_SIMPLE(&at_ids_1);
         if (idom_list_1) {
            _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&idom_list_1);
         }
         _fx_free_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t(&v_206);
         if (prev_body_code_0) {
            _fx_free_LN14K_form__kexp_t(&prev_body_code_0);
         }
         if (pre_idom_ll_1) {
            _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&pre_idom_ll_1);
         }
         _fx_free_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(&v_205);
         if (idx_pat_0) {
            _fx_free_N10Ast__pat_t(&idx_pat_0);
         }
         if (pe_l_0) {
            _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&pe_l_0);
         }
         FX_CHECK_EXN(_fx_catch_68);
      }
      _fx_copy_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(&__fold_result___14, &v_199);
      FX_COPY_PTR(v_199.t0, &pre_idom_ll_0);
      FX_COPY_PTR(v_199.t1, &body_code_2);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            body_3, body_code_2, false, body_sc_1, &v_200, 0), _fx_catch_68);
      FX_COPY_PTR(v_200.t0, &last_e_1);
      FX_COPY_PTR(v_200.t1, &body_code_3);
      _fx_R10Ast__loc_t bloc_1;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(body_3, &bloc_1, 0), _fx_catch_68);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(last_e_1, body_code_3, true, &v_201), _fx_catch_68);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_201, &bloc_1, &body_kexp_1, 0),
         _fx_catch_68);
      FX_CALL(
         _fx_M11K_normalizeFM3revLT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t1LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
            pre_idom_ll_0, &v_202, 0), _fx_catch_68);
      FX_CALL(
         _fx_M6K_formFM7KExpMapN14K_form__kexp_t4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
            v_202, body_kexp_1, &vcase_21->t2, &kctx_0, &v_203), _fx_catch_68);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_203, code_0, fx_result);

   _fx_catch_68: ;
      if (v_203) {
         _fx_free_N14K_form__kexp_t(&v_203);
      }
      if (v_202) {
         _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&v_202);
      }
      if (body_kexp_1) {
         _fx_free_N14K_form__kexp_t(&body_kexp_1);
      }
      if (v_201) {
         _fx_free_LN14K_form__kexp_t(&v_201);
      }
      if (body_code_3) {
         _fx_free_LN14K_form__kexp_t(&body_code_3);
      }
      if (last_e_1) {
         _fx_free_N14K_form__kexp_t(&last_e_1);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_200);
      if (body_code_2) {
         _fx_free_LN14K_form__kexp_t(&body_code_2);
      }
      if (pre_idom_ll_0) {
         _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&pre_idom_ll_0);
      }
      _fx_free_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(&v_199);
      if (pew_ll_0) {
         _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&pew_ll_0);
      }
      _fx_free_T2LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_t(&__fold_result___14);
      FX_FREE_LIST_SIMPLE(&body_sc_1);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 19) {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_209 = {0};
      _fx_N14K_form__atom_t arr_1 = {0};
      _fx_LN14K_form__kexp_t code_52 = 0;
      _fx_N10Ast__typ_t probably_tuple_type_0 = 0;
      _fx_T2LN13K_form__dom_tLN14K_form__kexp_t v_210 = {0};
      _fx_LN13K_form__dom_t dlist_0 = 0;
      _fx_LN14K_form__kexp_t code_53 = 0;
      _fx_LN13K_form__dom_t v_211 = 0;
      _fx_N14K_form__kexp_t v_212 = 0;
      _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_22 =
         &e_0->u.ExpAt;
      _fx_LN10Ast__exp_t idxlist_0 = vcase_22->t3;
      FX_CALL(
         _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            vcase_22->t0, code_0, true, sc_0, &v_209, 0), _fx_catch_76);
      _fx_copy_N14K_form__atom_t(&v_209.t0, &arr_1);
      FX_COPY_PTR(v_209.t1, &code_52);
      if (idxlist_0 != 0) {
         if (idxlist_0->tl == 0) {
            _fx_N10Ast__typ_t v_213 = 0;
            FX_CALL(_fx_M3AstFM11get_exp_typN10Ast__typ_t1N10Ast__exp_t(idxlist_0->hd, &v_213, 0), _fx_catch_69);
            FX_CALL(_fx_M3AstFM9deref_typN10Ast__typ_t1N10Ast__typ_t(v_213, &probably_tuple_type_0, 0), _fx_catch_69);

         _fx_catch_69: ;
            if (v_213) {
               _fx_free_N10Ast__typ_t(&v_213);
            }
            goto _fx_endmatch_8;
         }
      }
      FX_COPY_PTR(_fx_g20K_normalize__TypVoid, &probably_tuple_type_0);

   _fx_endmatch_8: ;
      FX_CHECK_EXN(_fx_catch_76);
      if (FX_REC_VARIANT_TAG(probably_tuple_type_0) == 17) {
         if (idxlist_0 != 0) {
            _fx_N10Ast__exp_t tupidx_0 = idxlist_0->hd;
            bool res_9;
            FX_CALL(_fx_M11K_normalizeFM8is_rangeB1N10Ast__exp_t(tupidx_0, &res_9, 0), _fx_catch_76);
            if (!res_9) {
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_214 = {0};
               fx_exn_t v_215 = {0};
               _fx_T2R9Ast__id_tLN14K_form__kexp_t v_216 = {0};
               _fx_LN14K_form__kexp_t code_54 = 0;
               _fx_T2LN13K_form__dom_tLN14K_form__kexp_t __fold_result___15 = {0};
               _fx_LN10Ast__typ_t idxtype_0 = 0;
               FX_CALL(_fx_M3AstFM11get_exp_ctxT2N10Ast__typ_tRM5loc_t1N10Ast__exp_t(tupidx_0, &v_214, 0), _fx_catch_71);
               _fx_R10Ast__loc_t iloc_0 = v_214.t1;
               int_ v_217;
               FX_CALL(_fx_M11K_normalizeFM8length1_i1LN10Ast__exp_t(idxlist_0->tl, &v_217, 0), _fx_catch_71);
               if (v_217 != 0) {
                  fx_str_t slit_17 = FX_MAKE_STR("internal error: tuple index is not only");
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&eloc_0, &slit_17, &v_215, 0), _fx_catch_71);
                  FX_THROW(&v_215, false, _fx_catch_71);
               }
               fx_str_t slit_18 = FX_MAKE_STR("internal error: a literal instead of tuple");
               FX_CALL(
                  _fx_M11K_normalizeFM6exp2idT2R9Ast__id_tLN14K_form__kexp_t5N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_tS(
                     tupidx_0, code_52, false, sc_0, &slit_18, &v_216, 0), _fx_catch_71);
               _fx_R9Ast__id_t tup_id_0 = v_216.t0;
               FX_COPY_PTR(v_216.t1, &code_54);
               _fx_make_T2LN13K_form__dom_tLN14K_form__kexp_t(0, code_54, &__fold_result___15);
               int_ elnum_0 = 0;
               FX_COPY_PTR(probably_tuple_type_0->u.TypTuple, &idxtype_0);
               _fx_LN10Ast__typ_t lst_12 = idxtype_0;
               for (; lst_12; lst_12 = lst_12->tl, elnum_0 += 1) {
                  _fx_T2LN13K_form__dom_tLN14K_form__kexp_t v_218 = {0};
                  _fx_LN13K_form__dom_t dlist_1 = 0;
                  _fx_LN14K_form__kexp_t code_55 = 0;
                  _fx_N14K_form__ktyp_t v_219 = 0;
                  _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_220 = {0};
                  _fx_N14K_form__kexp_t v_221 = 0;
                  _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_222 = {0};
                  _fx_N14K_form__atom_t d_0 = {0};
                  _fx_LN14K_form__kexp_t code_56 = 0;
                  _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_223 = {0};
                  _fx_N14K_form__atom_t d_1 = {0};
                  _fx_LN14K_form__kexp_t code_57 = 0;
                  _fx_N13K_form__dom_t v_224 = {0};
                  _fx_T2LN13K_form__dom_tLN14K_form__kexp_t v_225 = {0};
                  _fx_N10Ast__typ_t eltyp_0 = lst_12->hd;
                  _fx_copy_T2LN13K_form__dom_tLN14K_form__kexp_t(&__fold_result___15, &v_218);
                  FX_COPY_PTR(v_218.t0, &dlist_1);
                  FX_COPY_PTR(v_218.t1, &code_55);
                  int_ v_226;
                  FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &v_226, 0), _fx_catch_70);
                  FX_CALL(
                     _fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(eltyp_0, &iloc_0, &v_219, 0),
                     _fx_catch_70);
                  _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(v_219, &iloc_0, &v_220);
                  FX_CALL(
                     _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&tup_id_0, elnum_0,
                        &v_220, &v_221), _fx_catch_70);
                  fx_str_t slit_19 = FX_MAKE_STR("idx");
                  FX_CALL(
                     _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(v_226,
                        &slit_19, v_221, false, code_55, &v_222, 0), _fx_catch_70);
                  _fx_copy_N14K_form__atom_t(&v_222.t0, &d_0);
                  FX_COPY_PTR(v_222.t1, &code_56);
                  FX_CALL(
                     _fx_M11K_normalizeFM14cast_if_neededT2N14K_form__atom_tLN14K_form__kexp_t4N14K_form__atom_tLN14K_form__kexp_tR10Ast__loc_tLN12Ast__scope_t(
                        &d_0, code_56, &iloc_0, sc_0, &v_223, 0), _fx_catch_70);
                  _fx_copy_N14K_form__atom_t(&v_223.t0, &d_1);
                  FX_COPY_PTR(v_223.t1, &code_57);
                  _fx_M6K_formFM10DomainElemN13K_form__dom_t1N14K_form__atom_t(&d_1, &v_224);
                  FX_CALL(_fx_cons_LN13K_form__dom_t(&v_224, dlist_1, false, &dlist_1), _fx_catch_70);
                  _fx_make_T2LN13K_form__dom_tLN14K_form__kexp_t(dlist_1, code_57, &v_225);
                  _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(&__fold_result___15);
                  _fx_copy_T2LN13K_form__dom_tLN14K_form__kexp_t(&v_225, &__fold_result___15);

               _fx_catch_70: ;
                  _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(&v_225);
                  _fx_free_N13K_form__dom_t(&v_224);
                  if (code_57) {
                     _fx_free_LN14K_form__kexp_t(&code_57);
                  }
                  _fx_free_N14K_form__atom_t(&d_1);
                  _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_223);
                  if (code_56) {
                     _fx_free_LN14K_form__kexp_t(&code_56);
                  }
                  _fx_free_N14K_form__atom_t(&d_0);
                  _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_222);
                  if (v_221) {
                     _fx_free_N14K_form__kexp_t(&v_221);
                  }
                  _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_220);
                  if (v_219) {
                     _fx_free_N14K_form__ktyp_t(&v_219);
                  }
                  if (code_55) {
                     _fx_free_LN14K_form__kexp_t(&code_55);
                  }
                  if (dlist_1) {
                     _fx_free_LN13K_form__dom_t(&dlist_1);
                  }
                  _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(&v_218);
                  FX_CHECK_EXN(_fx_catch_71);
               }
               _fx_copy_T2LN13K_form__dom_tLN14K_form__kexp_t(&__fold_result___15, &v_210);

            _fx_catch_71: ;
               if (idxtype_0) {
                  _fx_free_LN10Ast__typ_t(&idxtype_0);
               }
               _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(&__fold_result___15);
               if (code_54) {
                  _fx_free_LN14K_form__kexp_t(&code_54);
               }
               _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_216);
               fx_free_exn(&v_215);
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_214);
               goto _fx_endmatch_9;
            }
         }
      }
      _fx_T2LN13K_form__dom_tLN14K_form__kexp_t __fold_result___16 = {0};
      _fx_LN10Ast__exp_t idxlist_1 = 0;
      _fx_make_T2LN13K_form__dom_tLN14K_form__kexp_t(0, code_52, &__fold_result___16);
      int_ idx_1 = 0;
      FX_COPY_PTR(idxlist_0, &idxlist_1);
      _fx_LN10Ast__exp_t lst_13 = idxlist_1;
      for (; lst_13; lst_13 = lst_13->tl, idx_1 += 1) {
         _fx_T2LN13K_form__dom_tLN14K_form__kexp_t v_227 = {0};
         _fx_LN13K_form__dom_t dlist_2 = 0;
         _fx_LN14K_form__kexp_t code_58 = 0;
         _fx_T2N14K_form__atom_ti v_228 = {0};
         _fx_LT2N14K_form__atom_ti v_229 = 0;
         _fx_T2N13K_form__dom_tLN14K_form__kexp_t v_230 = {0};
         fx_exn_t exn_2 = {0};
         _fx_LT2N14K_form__atom_ti v_231 = 0;
         _fx_N13K_form__dom_t d_2 = {0};
         _fx_LN14K_form__kexp_t code_59 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_232 = {0};
         _fx_T2N13K_form__dom_tLN14K_form__kexp_t v_233 = {0};
         _fx_N13K_form__dom_t d_3 = {0};
         _fx_LN14K_form__kexp_t code_60 = 0;
         _fx_T2LN13K_form__dom_tLN14K_form__kexp_t v_234 = {0};
         _fx_N10Ast__exp_t i_0 = lst_13->hd;
         _fx_copy_T2LN13K_form__dom_tLN14K_form__kexp_t(&__fold_result___16, &v_227);
         FX_COPY_PTR(v_227.t0, &dlist_2);
         FX_COPY_PTR(v_227.t1, &code_58);
         _fx_make_T2N14K_form__atom_ti(&arr_1, idx_1, &v_228);
         FX_CALL(_fx_cons_LT2N14K_form__atom_ti(&v_228, _fx_g29K_normalize__idx_access_stack, true, &v_229), _fx_catch_74);
         _fx_free_LT2N14K_form__atom_ti(&_fx_g29K_normalize__idx_access_stack);
         FX_COPY_PTR(v_229, &_fx_g29K_normalize__idx_access_stack);
         _fx_T2N13K_form__dom_tLN14K_form__kexp_t v_235 = {0};
         _fx_LT2N14K_form__atom_ti v_236 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM7exp2domT2N13K_form__dom_tLN14K_form__kexp_t3N10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
               i_0, code_58, sc_0, &v_235, 0), _fx_catch_72);
         FX_CALL(
            _fx_M11K_normalizeFM2tlLT2N14K_form__atom_ti1LT2N14K_form__atom_ti(_fx_g29K_normalize__idx_access_stack, &v_236, 0),
            _fx_catch_72);
         _fx_free_LT2N14K_form__atom_ti(&_fx_g29K_normalize__idx_access_stack);
         FX_COPY_PTR(v_236, &_fx_g29K_normalize__idx_access_stack);
         _fx_copy_T2N13K_form__dom_tLN14K_form__kexp_t(&v_235, &v_230);

      _fx_catch_72: ;
         _fx_free_T2N13K_form__dom_tLN14K_form__kexp_t(&v_235);
         if (v_236) {
            _fx_free_LT2N14K_form__atom_ti(&v_236);
         }
         if (fx_status < 0) {
            fx_exn_get_and_reset(fx_status, &exn_2);
            fx_status = 0;
            _fx_free_T2N13K_form__dom_tLN14K_form__kexp_t(&v_230);
            FX_CALL(
               _fx_M11K_normalizeFM2tlLT2N14K_form__atom_ti1LT2N14K_form__atom_ti(_fx_g29K_normalize__idx_access_stack, &v_231,
                  0), _fx_catch_74);
            _fx_free_LT2N14K_form__atom_ti(&_fx_g29K_normalize__idx_access_stack);
            FX_COPY_PTR(v_231, &_fx_g29K_normalize__idx_access_stack);
            FX_THROW(&exn_2, false, _fx_catch_74);
         }
         _fx_copy_N13K_form__dom_t(&v_230.t0, &d_2);
         FX_COPY_PTR(v_230.t1, &code_59);
         FX_CALL(_fx_M3AstFM11get_exp_ctxT2N10Ast__typ_tRM5loc_t1N10Ast__exp_t(i_0, &v_232, 0), _fx_catch_74);
         _fx_R10Ast__loc_t iloc_1 = v_232.t1;
         if (d_2.tag == 1) {
            _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_237 = {0};
            _fx_N14K_form__atom_t scalar_idx_0 = {0};
            _fx_LN14K_form__kexp_t code_61 = 0;
            _fx_N13K_form__dom_t v_238 = {0};
            FX_CALL(
               _fx_M11K_normalizeFM14cast_if_neededT2N14K_form__atom_tLN14K_form__kexp_t4N14K_form__atom_tLN14K_form__kexp_tR10Ast__loc_tLN12Ast__scope_t(
                  &d_2.u.DomainElem, code_59, &iloc_1, sc_0, &v_237, 0), _fx_catch_73);
            _fx_copy_N14K_form__atom_t(&v_237.t0, &scalar_idx_0);
            FX_COPY_PTR(v_237.t1, &code_61);
            _fx_M6K_formFM10DomainElemN13K_form__dom_t1N14K_form__atom_t(&scalar_idx_0, &v_238);
            _fx_make_T2N13K_form__dom_tLN14K_form__kexp_t(&v_238, code_61, &v_233);

         _fx_catch_73: ;
            _fx_free_N13K_form__dom_t(&v_238);
            if (code_61) {
               _fx_free_LN14K_form__kexp_t(&code_61);
            }
            _fx_free_N14K_form__atom_t(&scalar_idx_0);
            _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_237);
         }
         else {
            _fx_make_T2N13K_form__dom_tLN14K_form__kexp_t(&d_2, code_59, &v_233);
         }
         FX_CHECK_EXN(_fx_catch_74);
         _fx_copy_N13K_form__dom_t(&v_233.t0, &d_3);
         FX_COPY_PTR(v_233.t1, &code_60);
         FX_CALL(_fx_cons_LN13K_form__dom_t(&d_3, dlist_2, false, &dlist_2), _fx_catch_74);
         _fx_make_T2LN13K_form__dom_tLN14K_form__kexp_t(dlist_2, code_60, &v_234);
         _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(&__fold_result___16);
         _fx_copy_T2LN13K_form__dom_tLN14K_form__kexp_t(&v_234, &__fold_result___16);

      _fx_catch_74: ;
         _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(&v_234);
         if (code_60) {
            _fx_free_LN14K_form__kexp_t(&code_60);
         }
         _fx_free_N13K_form__dom_t(&d_3);
         _fx_free_T2N13K_form__dom_tLN14K_form__kexp_t(&v_233);
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_232);
         if (code_59) {
            _fx_free_LN14K_form__kexp_t(&code_59);
         }
         _fx_free_N13K_form__dom_t(&d_2);
         if (v_231) {
            _fx_free_LT2N14K_form__atom_ti(&v_231);
         }
         fx_free_exn(&exn_2);
         _fx_free_T2N13K_form__dom_tLN14K_form__kexp_t(&v_230);
         if (v_229) {
            _fx_free_LT2N14K_form__atom_ti(&v_229);
         }
         _fx_free_T2N14K_form__atom_ti(&v_228);
         if (code_58) {
            _fx_free_LN14K_form__kexp_t(&code_58);
         }
         if (dlist_2) {
            _fx_free_LN13K_form__dom_t(&dlist_2);
         }
         _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(&v_227);
         FX_CHECK_EXN(_fx_catch_75);
      }
      _fx_copy_T2LN13K_form__dom_tLN14K_form__kexp_t(&__fold_result___16, &v_210);

   _fx_catch_75: ;
      if (idxlist_1) {
         _fx_free_LN10Ast__exp_t(&idxlist_1);
      }
      _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(&__fold_result___16);

   _fx_endmatch_9: ;
      FX_CHECK_EXN(_fx_catch_76);
      FX_COPY_PTR(v_210.t0, &dlist_0);
      FX_COPY_PTR(v_210.t1, &code_53);
      FX_CALL(_fx_M11K_normalizeFM3revLN13K_form__dom_t1LN13K_form__dom_t(dlist_0, &v_211, 0), _fx_catch_76);
      FX_CALL(
         _fx_M6K_formFM6KExpAtN14K_form__kexp_t5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &arr_1, &vcase_22->t1, &vcase_22->t2, v_211, &kctx_0, &v_212), _fx_catch_76);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_212, code_53, fx_result);

   _fx_catch_76: ;
      if (v_212) {
         _fx_free_N14K_form__kexp_t(&v_212);
      }
      if (v_211) {
         _fx_free_LN13K_form__dom_t(&v_211);
      }
      if (code_53) {
         _fx_free_LN14K_form__kexp_t(&code_53);
      }
      if (dlist_0) {
         _fx_free_LN13K_form__dom_t(&dlist_0);
      }
      _fx_free_T2LN13K_form__dom_tLN14K_form__kexp_t(&v_210);
      if (probably_tuple_type_0) {
         _fx_free_N10Ast__typ_t(&probably_tuple_type_0);
      }
      if (code_52) {
         _fx_free_LN14K_form__kexp_t(&code_52);
      }
      _fx_free_N14K_form__atom_t(&arr_1);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_209);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 21) {
      _fx_T2R9Ast__id_tLN14K_form__kexp_t v_239 = {0};
      _fx_LN14K_form__kexp_t code_62 = 0;
      _fx_N14K_form__ktyp_t ktyp_1 = 0;
      _fx_N15K_form__kinfo_t v_240 = {0};
      _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_23 = &e_0->u.ExpMem;
      _fx_N10Ast__exp_t elem_0 = vcase_23->t1;
      _fx_N10Ast__exp_t e1_7 = vcase_23->t0;
      _fx_R10Ast__loc_t e1loc_0;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e1_7, &e1loc_0, 0), _fx_catch_85);
      fx_str_t slit_20 = FX_MAKE_STR("the literal does not have members to access");
      FX_CALL(
         _fx_M11K_normalizeFM6exp2idT2R9Ast__id_tLN14K_form__kexp_t5N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_tS(e1_7,
            code_0, true, sc_0, &slit_20, &v_239, 0), _fx_catch_85);
      _fx_R9Ast__id_t a_id_2 = v_239.t0;
      FX_COPY_PTR(v_239.t1, &code_62);
      FX_CALL(_fx_M6K_formFM12get_idk_ktypN14K_form__ktyp_t2R9Ast__id_tR10Ast__loc_t(&a_id_2, &e1loc_0, &ktyp_1, 0),
         _fx_catch_85);
      if (FX_REC_VARIANT_TAG(elem_0) == 6) {
         _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* vcase_24 = &elem_0->u.ExpLit;
         _fx_N10Ast__lit_t* v_241 = &vcase_24->t0;
         if (v_241->tag == 1) {
            if (FX_REC_VARIANT_TAG(ktyp_1) == 14) {
               fx_str_t v_242 = {0};
               fx_str_t v_243 = {0};
               fx_exn_t v_244 = {0};
               _fx_N14K_form__kexp_t v_245 = 0;
               int_ idx_2;
               FX_CALL(_fx_M11K_normalizeFM3inti1l(v_241->u.LitInt, &idx_2, 0), _fx_catch_77);
               int_ n_1;
               FX_CALL(_fx_M11K_normalizeFM8length1_i1LN14K_form__ktyp_t(ktyp_1->u.KTypTuple, &n_1, 0), _fx_catch_77);
               if (!(bool)((0 <= idx_2) & (idx_2 < n_1))) {
                  FX_CALL(_fx_F6stringS1i(n_1, &v_242, 0), _fx_catch_77);
                  fx_str_t slit_21 = FX_MAKE_STR("the tuple index is outside of the range [0, ");
                  fx_str_t slit_22 = FX_MAKE_STR(")");
                  {
                     const fx_str_t strs_1[] = { slit_21, v_242, slit_22 };
                     FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_243), _fx_catch_77);
                  }
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&vcase_24->t1.t1, &v_243, &v_244, 0), _fx_catch_77);
                  FX_THROW(&v_244, false, _fx_catch_77);
               }
               FX_CALL(
                  _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&a_id_2, idx_2, &kctx_0,
                     &v_245), _fx_catch_77);
               _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_245, code_62, fx_result);

            _fx_catch_77: ;
               if (v_245) {
                  _fx_free_N14K_form__kexp_t(&v_245);
               }
               fx_free_exn(&v_244);
               FX_FREE_STR(&v_243);
               FX_FREE_STR(&v_242);
               goto _fx_endmatch_10;
            }
         }
      }
      if (FX_REC_VARIANT_TAG(elem_0) == 7) {
         if (FX_REC_VARIANT_TAG(ktyp_1) == 15) {
            _fx_N14K_form__kexp_t v_246 = 0;
            _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* vcase_25 = &ktyp_1->u.KTypRecord;
            int_ i_1;
            FX_CALL(
               _fx_M11K_normalizeFM10find_relemi4R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_tR9Ast__id_tR10Ast__loc_t(
                  &vcase_25->t0, vcase_25->t1, &elem_0->u.ExpIdent.t0, &eloc_0, &i_1, 0), _fx_catch_78);
            FX_CALL(
               _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&a_id_2, i_1, &kctx_0,
                  &v_246), _fx_catch_78);
            _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_246, code_62, fx_result);

         _fx_catch_78: ;
            if (v_246) {
               _fx_free_N14K_form__kexp_t(&v_246);
            }
            goto _fx_endmatch_10;
         }
      }
      if (FX_REC_VARIANT_TAG(elem_0) == 7) {
         if (FX_REC_VARIANT_TAG(ktyp_1) == 16) {
            _fx_R9Ast__id_t* tn_0 = &ktyp_1->u.KTypName;
            _fx_R9Ast__id_t* n_2 = &elem_0->u.ExpIdent.t0;
            FX_CALL(_fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(tn_0, &eloc_0, &v_240, 0), _fx_catch_85);
            bool res_10;
            if (v_240.tag == 7) {
               res_10 = true;
            }
            else {
               res_10 = false;
            }
            FX_CHECK_EXN(_fx_catch_85);
            if (res_10) {
               _fx_rR19Ast__definterface_t iface_0 = 0;
               _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t v_247 = 0;
               fx_str_t v_248 = {0};
               fx_str_t v_249 = {0};
               fx_str_t v_250 = {0};
               fx_str_t v_251 = {0};
               fx_str_t v_252 = {0};
               fx_exn_t v_253 = {0};
               _fx_N14K_form__kexp_t v_254 = 0;
               FX_CALL(_fx_M3AstFM9get_ifacerRM14definterface_t2RM4id_tRM5loc_t(tn_0, &eloc_0, &iface_0, 0), _fx_catch_80);
               int_ idx_3 = -1;
               FX_COPY_PTR(iface_0->data.di_all_methods, &v_247);
               int_ i_2 = 0;
               _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t lst_14 = v_247;
               for (; lst_14; lst_14 = lst_14->tl, i_2 += 1) {
                  _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* __pat___5 = &lst_14->hd;
                  _fx_R9Ast__id_t f_2 = __pat___5->t0;
                  bool res_11;
                  FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&f_2, n_2, &res_11, 0), _fx_catch_79);
                  if (res_11) {
                     idx_3 = i_2; FX_BREAK(_fx_catch_79);
                  }

               _fx_catch_79: ;
                  FX_CHECK_BREAK();
                  FX_CHECK_EXN(_fx_catch_80);
               }
               if (idx_3 < 0) {
                  FX_CALL(_fx_M3AstFM2ppS1RM4id_t(n_2, &v_248, 0), _fx_catch_80);
                  FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_248, &v_249, 0), _fx_catch_80);
                  FX_CALL(_fx_M6K_formFM7idk2strS2R9Ast__id_tR10Ast__loc_t(tn_0, &eloc_0, &v_250, 0), _fx_catch_80);
                  FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_250, &v_251, 0), _fx_catch_80);
                  fx_str_t slit_23 = FX_MAKE_STR("k-norm: method \'");
                  fx_str_t slit_24 = FX_MAKE_STR("\' is not found in interface \'");
                  fx_str_t slit_25 = FX_MAKE_STR("\'");
                  {
                     const fx_str_t strs_2[] = { slit_23, v_249, slit_24, v_251, slit_25 };
                     FX_CALL(fx_strjoin(0, 0, 0, strs_2, 5, &v_252), _fx_catch_80);
                  }
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&eloc_0, &v_252, &v_253, 0), _fx_catch_80);
                  FX_THROW(&v_253, false, _fx_catch_80);
               }
               FX_CALL(
                  _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&a_id_2, idx_3, &kctx_0,
                     &v_254), _fx_catch_80);
               _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_254, code_62, fx_result);

            _fx_catch_80: ;
               if (v_254) {
                  _fx_free_N14K_form__kexp_t(&v_254);
               }
               fx_free_exn(&v_253);
               FX_FREE_STR(&v_252);
               FX_FREE_STR(&v_251);
               FX_FREE_STR(&v_250);
               FX_FREE_STR(&v_249);
               FX_FREE_STR(&v_248);
               if (v_247) {
                  _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&v_247);
               }
               if (iface_0) {
                  _fx_free_rR19Ast__definterface_t(&iface_0);
               }
               goto _fx_endmatch_10;
            }
         }
      }
      if (FX_REC_VARIANT_TAG(elem_0) == 7) {
         if (FX_REC_VARIANT_TAG(ktyp_1) == 16) {
            _fx_N14K_form__atom_t v_255 = {0};
            _fx_LN14K_form__atom_t v_256 = 0;
            _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_257 = {0};
            _fx_N14K_form__kexp_t v_258 = 0;
            _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t v_259 = {0};
            _fx_N14K_form__ktyp_t vt_0 = 0;
            _fx_LT2R9Ast__id_tN14K_form__ktyp_t relems_3 = 0;
            _fx_N14K_form__atom_t v_260 = {0};
            _fx_N14K_form__klit_t v_261 = {0};
            _fx_N14K_form__atom_t v_262 = {0};
            _fx_LN14K_form__atom_t v_263 = 0;
            _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_264 = {0};
            _fx_N14K_form__kexp_t get_vcase_0 = 0;
            _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_265 = {0};
            _fx_T2R9Ast__id_tLN14K_form__kexp_t v_266 = {0};
            _fx_LN14K_form__kexp_t code_63 = 0;
            _fx_N14K_form__kexp_t v_267 = 0;
            _fx_N14K_form__kexp_t get_elem_0 = 0;
            _fx_LN14K_form__kexp_t code_64 = 0;
            _fx_R9Ast__id_t* n_3 = &elem_0->u.ExpIdent.t0;
            bool res_12;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(n_3, &_fx_g15Ast__std__tag__, &res_12, 0), _fx_catch_81);
            if (res_12) {
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&a_id_2, &v_255);
               FX_CALL(_fx_cons_LN14K_form__atom_t(&v_255, 0, true, &v_256), _fx_catch_81);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypCInt, &eloc_0, &v_257);
               FX_CALL(
                  _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
                     &_fx_g29K_normalize__IntrinVariantTag, v_256, &v_257, &v_258), _fx_catch_81);
               _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_258, code_62, fx_result);
            }
            else {
               FX_CALL(
                  _fx_M11K_normalizeFM18get_record_elems_kT2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t3Nt6option1R9Ast__id_tN14K_form__ktyp_tR10Ast__loc_t(
                     &_fx_g19K_normalize__None6_, ktyp_1, &eloc_0, &v_259, 0), _fx_catch_81);
               _fx_T4R9Ast__id_tiN14K_form__ktyp_tB* v_268 = &v_259.t0;
               _fx_R9Ast__id_t ctor_2 = v_268->t0;
               int_ case_i_0 = v_268->t1;
               FX_COPY_PTR(v_268->t2, &vt_0);
               FX_COPY_PTR(v_259.t1, &relems_3);
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&a_id_2, &v_260);
               int64_t res_13;
               FX_CALL(_fx_M11K_normalizeFM5int64l1i(case_i_0, &res_13, 0), _fx_catch_81);
               _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(res_13, &v_261);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_261, &v_262);
               FX_CALL(_fx_cons_LN14K_form__atom_t(&v_262, 0, true, &v_263), _fx_catch_81);
               FX_CALL(_fx_cons_LN14K_form__atom_t(&v_260, v_263, false, &v_263), _fx_catch_81);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(vt_0, &eloc_0, &v_264);
               FX_CALL(
                  _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
                     &_fx_g30K_normalize__IntrinVariantCase, v_263, &v_264, &get_vcase_0), _fx_catch_81);
               int_ i_3;
               FX_CALL(
                  _fx_M11K_normalizeFM10find_relemi4R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_tR9Ast__id_tR10Ast__loc_t(&ctor_2,
                     relems_3, n_3, &eloc_0, &i_3, 0), _fx_catch_81);
               int_ v_269;
               FX_CALL(_fx_M11K_normalizeFM8length1_i1LT2R9Ast__id_tN14K_form__ktyp_t(relems_3, &v_269, 0), _fx_catch_81);
               if (v_269 == 1) {
                  _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(get_vcase_0, code_62, &v_265);
               }
               else {
                  fx_str_t slit_26 = FX_MAKE_STR("vcase");
                  fx_str_t slit_27 = FX_MAKE_STR("variant case extraction should produce id, not literal");
                  FX_CALL(
                     _fx_M6K_formFM7kexp2idT2R9Ast__id_tLN14K_form__kexp_t6iSN14K_form__kexp_tBLN14K_form__kexp_tS(km_idx_0,
                        &slit_26, get_vcase_0, true, code_62, &slit_27, &v_266, 0), _fx_catch_81);
                  _fx_R9Ast__id_t v_id_0 = v_266.t0;
                  FX_COPY_PTR(v_266.t1, &code_63);
                  FX_CALL(
                     _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&v_id_0, i_3, &kctx_0,
                        &v_267), _fx_catch_81);
                  _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_267, code_63, &v_265);
               }
               FX_COPY_PTR(v_265.t0, &get_elem_0);
               FX_COPY_PTR(v_265.t1, &code_64);
               _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(get_elem_0, code_64, fx_result);
            }

         _fx_catch_81: ;
            if (code_64) {
               _fx_free_LN14K_form__kexp_t(&code_64);
            }
            if (get_elem_0) {
               _fx_free_N14K_form__kexp_t(&get_elem_0);
            }
            if (v_267) {
               _fx_free_N14K_form__kexp_t(&v_267);
            }
            if (code_63) {
               _fx_free_LN14K_form__kexp_t(&code_63);
            }
            _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_266);
            _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_265);
            if (get_vcase_0) {
               _fx_free_N14K_form__kexp_t(&get_vcase_0);
            }
            _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_264);
            if (v_263) {
               _fx_free_LN14K_form__atom_t(&v_263);
            }
            _fx_free_N14K_form__atom_t(&v_262);
            _fx_free_N14K_form__klit_t(&v_261);
            _fx_free_N14K_form__atom_t(&v_260);
            if (relems_3) {
               _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&relems_3);
            }
            if (vt_0) {
               _fx_free_N14K_form__ktyp_t(&vt_0);
            }
            _fx_free_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t(&v_259);
            if (v_258) {
               _fx_free_N14K_form__kexp_t(&v_258);
            }
            _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_257);
            if (v_256) {
               _fx_free_LN14K_form__atom_t(&v_256);
            }
            _fx_free_N14K_form__atom_t(&v_255);
            goto _fx_endmatch_10;
         }
      }
      if (FX_REC_VARIANT_TAG(ktyp_1) == 21) {
         if (FX_REC_VARIANT_TAG(elem_0) == 7) {
            bool res_14;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&elem_0->u.ExpIdent.t0, &_fx_g15Ast__std__tag__, &res_14, 0),
               _fx_catch_85);
            if (res_14) {
               _fx_N14K_form__atom_t v_270 = {0};
               _fx_LN14K_form__atom_t v_271 = 0;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_272 = {0};
               _fx_N14K_form__kexp_t v_273 = 0;
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&a_id_2, &v_270);
               FX_CALL(_fx_cons_LN14K_form__atom_t(&v_270, 0, true, &v_271), _fx_catch_82);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypCInt, &eloc_0, &v_272);
               FX_CALL(
                  _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
                     &_fx_g29K_normalize__IntrinVariantTag, v_271, &v_272, &v_273), _fx_catch_82);
               _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_273, code_62, fx_result);

            _fx_catch_82: ;
               if (v_273) {
                  _fx_free_N14K_form__kexp_t(&v_273);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_272);
               if (v_271) {
                  _fx_free_LN14K_form__atom_t(&v_271);
               }
               _fx_free_N14K_form__atom_t(&v_270);
               goto _fx_endmatch_10;
            }
         }
      }
      if (FX_REC_VARIANT_TAG(elem_0) == 7) {
         _fx_N10Ast__typ_t v_274 = 0;
         fx_str_t v_275 = {0};
         fx_str_t v_276 = {0};
         fx_str_t v_277 = {0};
         fx_str_t v_278 = {0};
         fx_str_t v_279 = {0};
         fx_exn_t v_280 = {0};
         FX_CALL(_fx_M3AstFM11get_exp_typN10Ast__typ_t1N10Ast__exp_t(e1_7, &v_274, 0), _fx_catch_83);
         FX_CALL(_fx_M3AstFM7typ2strS1N10Ast__typ_t(v_274, &v_275, 0), _fx_catch_83);
         FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_275, &v_276, 0), _fx_catch_83);
         FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&elem_0->u.ExpIdent.t0, &v_277, 0), _fx_catch_83);
         FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_277, &v_278, 0), _fx_catch_83);
         fx_str_t slit_28 = FX_MAKE_STR("unsupported \'(some_struct : ");
         fx_str_t slit_29 = FX_MAKE_STR(").");
         fx_str_t slit_30 = FX_MAKE_STR("\' access operation");
         {
            const fx_str_t strs_3[] = { slit_28, v_276, slit_29, v_278, slit_30 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_3, 5, &v_279), _fx_catch_83);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&e1loc_0, &v_279, &v_280, 0), _fx_catch_83);
         FX_THROW(&v_280, false, _fx_catch_83);

      _fx_catch_83: ;
         fx_free_exn(&v_280);
         FX_FREE_STR(&v_279);
         FX_FREE_STR(&v_278);
         FX_FREE_STR(&v_277);
         FX_FREE_STR(&v_276);
         FX_FREE_STR(&v_275);
         if (v_274) {
            _fx_free_N10Ast__typ_t(&v_274);
         }
         goto _fx_endmatch_10;
      }
      fx_exn_t v_281 = {0};
      fx_str_t slit_31 = FX_MAKE_STR("unsupported access operation");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&e1loc_0, &slit_31, &v_281, 0), _fx_catch_84);
      FX_THROW(&v_281, false, _fx_catch_84);

   _fx_catch_84: ;
      fx_free_exn(&v_281);

   _fx_endmatch_10: ;
      FX_CHECK_EXN(_fx_catch_85);

   _fx_catch_85: ;
      _fx_free_N15K_form__kinfo_t(&v_240);
      if (ktyp_1) {
         _fx_free_N14K_form__ktyp_t(&ktyp_1);
      }
      if (code_62) {
         _fx_free_LN14K_form__kexp_t(&code_62);
      }
      _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_239);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 20) {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_282 = {0};
      _fx_N14K_form__atom_t a2_3 = {0};
      _fx_LN14K_form__kexp_t code_65 = 0;
      _fx_T2R9Ast__id_tLN14K_form__kexp_t v_283 = {0};
      _fx_LN14K_form__kexp_t code_66 = 0;
      _fx_R17K_form__kdefval_t kv_0 = {0};
      _fx_N14K_form__ktyp_t kv_typ_0 = 0;
      _fx_R16Ast__val_flags_t kv_flags_0 = {0};
      _fx_R16Ast__val_flags_t kv_flags_1 = {0};
      _fx_LN10Ast__exp_t idxs_0 = 0;
      _fx_R16Ast__val_flags_t v_284 = {0};
      _fx_R17K_form__kdefval_t kv_1 = {0};
      _fx_N15K_form__kinfo_t v_285 = {0};
      _fx_N14K_form__kexp_t v_286 = 0;
      _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* vcase_26 = &e_0->u.ExpAssign;
      _fx_N10Ast__exp_t e1_8 = vcase_26->t0;
      FX_CALL(
         _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            vcase_26->t1, code_0, false, sc_0, &v_282, 0), _fx_catch_87);
      _fx_copy_N14K_form__atom_t(&v_282.t0, &a2_3);
      FX_COPY_PTR(v_282.t1, &code_65);
      fx_str_t slit_32 = FX_MAKE_STR("a literal cannot be assigned");
      FX_CALL(
         _fx_M11K_normalizeFM6exp2idT2R9Ast__id_tLN14K_form__kexp_t5N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_tS(e1_8,
            code_65, true, sc_0, &slit_32, &v_283, 0), _fx_catch_87);
      _fx_R9Ast__id_t a_id_3 = v_283.t0;
      FX_COPY_PTR(v_283.t1, &code_66);
      FX_CALL(_fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(&a_id_3, &eloc_0, &kv_0, 0), _fx_catch_87);
      FX_COPY_PTR(kv_0.kv_typ, &kv_typ_0);
      _fx_copy_R16Ast__val_flags_t(&kv_0.kv_flags, &kv_flags_0);
      if (FX_REC_VARIANT_TAG(kv_typ_0) == 17) {
         if (FX_REC_VARIANT_TAG(e1_8) == 19) {
            bool __fold_result___17 = false;
            FX_COPY_PTR(e1_8->u.ExpAt.t3, &idxs_0);
            _fx_LN10Ast__exp_t lst_15 = idxs_0;
            for (; lst_15; lst_15 = lst_15->tl) {
               _fx_N10Ast__exp_t idx_4 = lst_15->hd;
               bool res_15;
               FX_CALL(_fx_M11K_normalizeFM8is_rangeB1N10Ast__exp_t(idx_4, &res_15, 0), _fx_catch_86);
               if (res_15) {
                  __fold_result___17 = true; FX_BREAK(_fx_catch_86);
               }

            _fx_catch_86: ;
               FX_CHECK_BREAK();
               FX_CHECK_EXN(_fx_catch_87);
            }
            if (__fold_result___17) {
               _fx_make_R16Ast__val_flags_t(kv_flags_0.val_flag_arg, kv_flags_0.val_flag_mutable, kv_flags_0.val_flag_temp,
                  kv_flags_0.val_flag_tempref, kv_flags_0.val_flag_private, true, kv_flags_0.val_flag_instance,
                  &kv_flags_0.val_flag_method, kv_flags_0.val_flag_ctor, kv_flags_0.val_flag_global, &kv_flags_1);
               goto _fx_endmatch_11;
            }
         }
      }
      _fx_copy_R16Ast__val_flags_t(&kv_flags_0, &kv_flags_1);

   _fx_endmatch_11: ;
      FX_CHECK_EXN(_fx_catch_87);
      _fx_make_R16Ast__val_flags_t(kv_flags_1.val_flag_arg, true, kv_flags_1.val_flag_temp, kv_flags_1.val_flag_tempref,
         kv_flags_1.val_flag_private, kv_flags_1.val_flag_subarray, kv_flags_1.val_flag_instance, &kv_flags_1.val_flag_method,
         kv_flags_1.val_flag_ctor, kv_flags_1.val_flag_global, &v_284);
      _fx_make_R17K_form__kdefval_t(&kv_0.kv_name, &kv_0.kv_cname, kv_0.kv_typ, &v_284, &kv_0.kv_loc, &kv_1);
      _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(&kv_1, &v_285);
      FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(&a_id_3, &v_285, 0), _fx_catch_87);
      FX_CALL(
         _fx_M6K_formFM10KExpAssignN14K_form__kexp_t3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(&a_id_3, &a2_3, &eloc_0, &v_286),
         _fx_catch_87);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_286, code_66, fx_result);

   _fx_catch_87: ;
      if (v_286) {
         _fx_free_N14K_form__kexp_t(&v_286);
      }
      _fx_free_N15K_form__kinfo_t(&v_285);
      _fx_free_R17K_form__kdefval_t(&kv_1);
      _fx_free_R16Ast__val_flags_t(&v_284);
      if (idxs_0) {
         _fx_free_LN10Ast__exp_t(&idxs_0);
      }
      _fx_free_R16Ast__val_flags_t(&kv_flags_1);
      _fx_free_R16Ast__val_flags_t(&kv_flags_0);
      if (kv_typ_0) {
         _fx_free_N14K_form__ktyp_t(&kv_typ_0);
      }
      _fx_free_R17K_form__kdefval_t(&kv_0);
      if (code_66) {
         _fx_free_LN14K_form__kexp_t(&code_66);
      }
      _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_283);
      if (code_65) {
         _fx_free_LN14K_form__kexp_t(&code_65);
      }
      _fx_free_N14K_form__atom_t(&a2_3);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_282);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 30) {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_287 = {0};
      _fx_N14K_form__atom_t a_6 = {0};
      _fx_LN14K_form__kexp_t code_67 = 0;
      _fx_N14K_form__kexp_t v_288 = 0;
      FX_CALL(
         _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e_0->u.ExpCast.t0, code_0, false, sc_0, &v_287, 0), _fx_catch_88);
      _fx_copy_N14K_form__atom_t(&v_287.t0, &a_6);
      FX_COPY_PTR(v_287.t1, &code_67);
      FX_CALL(
         _fx_M6K_formFM8KExpCastN14K_form__kexp_t3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(&a_6, ktyp_0, &eloc_0,
            &v_288), _fx_catch_88);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_288, code_67, fx_result);

   _fx_catch_88: ;
      if (v_288) {
         _fx_free_N14K_form__kexp_t(&v_288);
      }
      if (code_67) {
         _fx_free_LN14K_form__kexp_t(&code_67);
      }
      _fx_free_N14K_form__atom_t(&a_6);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_287);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 31) {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_289 = {0};
      _fx_N14K_form__atom_t a_7 = {0};
      _fx_LN14K_form__kexp_t code_68 = 0;
      _fx_N14K_form__ktyp_t t_1 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_290 = {0};
      _fx_N14K_form__kexp_t v_291 = 0;
      _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* vcase_27 = &e_0->u.ExpTyped;
      FX_CALL(
         _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            vcase_27->t0, code_0, false, sc_0, &v_289, 0), _fx_catch_89);
      _fx_copy_N14K_form__atom_t(&v_289.t0, &a_7);
      FX_COPY_PTR(v_289.t1, &code_68);
      FX_CALL(_fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(vcase_27->t1, &eloc_0, &t_1, 0),
         _fx_catch_89);
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(t_1, &eloc_0, &v_290);
      FX_CALL(_fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&a_7, &v_290, &v_291),
         _fx_catch_89);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_291, code_68, fx_result);

   _fx_catch_89: ;
      if (v_291) {
         _fx_free_N14K_form__kexp_t(&v_291);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_290);
      if (t_1) {
         _fx_free_N14K_form__ktyp_t(&t_1);
      }
      if (code_68) {
         _fx_free_LN14K_form__kexp_t(&code_68);
      }
      _fx_free_N14K_form__atom_t(&a_7);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_289);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 32) {
      _fx_N14K_form__kexp_t v_292 = 0;
      FX_CALL(_fx_M6K_formFM9KExpCCodeN14K_form__kexp_t2ST2N14K_form__ktyp_tR10Ast__loc_t(&e_0->u.ExpCCode.t0, &kctx_0, &v_292),
         _fx_catch_90);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_292, code_0, fx_result);

   _fx_catch_90: ;
      if (v_292) {
         _fx_free_N14K_form__kexp_t(&v_292);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 33) {
      _fx_N14K_form__kexp_t v_293 = 0;
      _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* vcase_28 = &e_0->u.ExpData;
      FX_CALL(
         _fx_M11K_normalizeFM10embed_dataN14K_form__kexp_t3SST2N14K_form__ktyp_tR10Ast__loc_t(&vcase_28->t0, &vcase_28->t1,
            &kctx_0, &v_293, 0), _fx_catch_91);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_293, code_0, fx_result);

   _fx_catch_91: ;
      if (v_293) {
         _fx_free_N14K_form__kexp_t(&v_293);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 29) {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_294 = {0};
      _fx_N14K_form__atom_t a_8 = {0};
      _fx_LN14K_form__kexp_t code_69 = 0;
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_295 = {0};
      _fx_N14K_form__ktyp_t t_2 = 0;
      _fx_R16Ast__val_flags_t v_296 = {0};
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_297 = {0};
      _fx_N14K_form__kexp_t v_298 = 0;
      _fx_Nt6option1N14K_form__kexp_t v_299 = {0};
      _fx_LN14K_form__kexp_t code_70 = 0;
      _fx_N14K_form__atom_t v_300 = {0};
      _fx_N14K_form__atom_t b_0 = {0};
      _fx_LN14K_form__kexp_t code_71 = 0;
      _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t v_301 = {0};
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t k_cases_0 = 0;
      _fx_LN14K_form__kexp_t code_72 = 0;
      _fx_N14K_form__kexp_t v_302 = 0;
      _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_29 = &e_0->u.ExpMatch;
      _fx_N10Ast__exp_t e1_9 = vcase_29->t0;
      _fx_R10Ast__loc_t loc1_2;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e1_9, &loc1_2, 0), _fx_catch_93);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e1_9, code_0, false, sc_0, &v_294, 0), _fx_catch_93);
      _fx_copy_N14K_form__atom_t(&v_294.t0, &a_8);
      FX_COPY_PTR(v_294.t1, &code_69);
      bool v_303;
      FX_CALL(_fx_M6K_formFM15is_mutable_atomB2N14K_form__atom_tR10Ast__loc_t(&a_8, &loc1_2, &v_303, 0), _fx_catch_93);
      if (!v_303) {
         _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(&a_8, code_69, &v_295);
      }
      else {
         _fx_R9Ast__id_t a_id_4;
         if (a_8.tag == 1) {
            a_id_4 = a_8.u.AtomId;
         }
         else {
            fx_exn_t v_304 = {0};
            fx_str_t slit_33 = FX_MAKE_STR("k-norm: invalid mutable atom (id is expected)");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc1_2, &slit_33, &v_304, 0), _fx_catch_92);
            FX_THROW(&v_304, false, _fx_catch_92);

         _fx_catch_92: ;
            fx_free_exn(&v_304);
         }
         FX_CHECK_EXN(_fx_catch_93);
         FX_CALL(_fx_M6K_formFM13get_atom_ktypN14K_form__ktyp_t2N14K_form__atom_tR10Ast__loc_t(&a_8, &loc1_2, &t_2, 0),
            _fx_catch_93);
         _fx_R9Ast__id_t b_1;
         FX_CALL(_fx_M6K_formFM7dup_idkR9Ast__id_t2iR9Ast__id_t(km_idx_0, &a_id_4, &b_1, 0), _fx_catch_93);
         FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_296, 0), _fx_catch_93);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(t_2, &loc1_2, &v_297);
         FX_CALL(
            _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&a_8, &v_297, &v_298),
            _fx_catch_93);
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(v_298, &v_299);
         FX_CALL(
            _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
               &b_1, t_2, &v_296, &v_299, code_69, &loc1_2, &code_70, 0), _fx_catch_93);
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&b_1, &v_300);
         _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(&v_300, code_70, &v_295);
      }
      _fx_copy_N14K_form__atom_t(&v_295.t0, &b_0);
      FX_COPY_PTR(v_295.t1, &code_71);
      FX_CALL(
         _fx_M11K_normalizeFM22transform_pat_matchingT2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t6N14K_form__atom_tLT2N10Ast__pat_tN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_tB(
            &b_0, vcase_29->t1, code_71, sc_0, &eloc_0, false, &v_301, 0), _fx_catch_93);
      FX_COPY_PTR(v_301.t0, &k_cases_0);
      FX_COPY_PTR(v_301.t1, &code_72);
      FX_CALL(
         _fx_M6K_formFM9KExpMatchN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
            k_cases_0, &kctx_0, &v_302), _fx_catch_93);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_302, code_72, fx_result);

   _fx_catch_93: ;
      if (v_302) {
         _fx_free_N14K_form__kexp_t(&v_302);
      }
      if (code_72) {
         _fx_free_LN14K_form__kexp_t(&code_72);
      }
      if (k_cases_0) {
         _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&k_cases_0);
      }
      _fx_free_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t(&v_301);
      if (code_71) {
         _fx_free_LN14K_form__kexp_t(&code_71);
      }
      _fx_free_N14K_form__atom_t(&b_0);
      _fx_free_N14K_form__atom_t(&v_300);
      if (code_70) {
         _fx_free_LN14K_form__kexp_t(&code_70);
      }
      _fx_free_Nt6option1N14K_form__kexp_t(&v_299);
      if (v_298) {
         _fx_free_N14K_form__kexp_t(&v_298);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_297);
      _fx_free_R16Ast__val_flags_t(&v_296);
      if (t_2) {
         _fx_free_N14K_form__ktyp_t(&t_2);
      }
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_295);
      if (code_69) {
         _fx_free_LN14K_form__kexp_t(&code_69);
      }
      _fx_free_N14K_form__atom_t(&a_8);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_294);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 28) {
      _fx_LN12Ast__scope_t try_sc_0 = 0;
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_305 = {0};
      _fx_N14K_form__kexp_t e1_10 = 0;
      _fx_LN14K_form__kexp_t body_code_5 = 0;
      _fx_LN14K_form__kexp_t v_306 = 0;
      _fx_N14K_form__kexp_t try_body_0 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_307 = {0};
      _fx_N14K_form__kexp_t pop_e_0 = 0;
      _fx_LN12Ast__scope_t catch_sc_0 = 0;
      _fx_R16Ast__val_flags_t v_308 = {0};
      _fx_Nt6option1N14K_form__kexp_t v_309 = {0};
      _fx_LN14K_form__kexp_t catch_code_0 = 0;
      _fx_N14K_form__atom_t v_310 = {0};
      _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t v_311 = {0};
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t k_cases_1 = 0;
      _fx_LN14K_form__kexp_t catch_code_1 = 0;
      _fx_N14K_form__kexp_t handle_exn_0 = 0;
      _fx_LN14K_form__kexp_t v_312 = 0;
      _fx_N14K_form__kexp_t handle_exn_1 = 0;
      _fx_N14K_form__kexp_t v_313 = 0;
      _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_30 = &e_0->u.ExpTryCatch;
      _fx_LT2N10Ast__pat_tN10Ast__exp_t cases_0 = vcase_30->t1;
      _fx_N10Ast__exp_t e1_11 = vcase_30->t0;
      _fx_R10Ast__loc_t e1loc_1;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e1_11, &e1loc_1, 0), _fx_catch_96);
      _fx_N12Ast__scope_t v_314;
      FX_CALL(_fx_M3AstFM15new_block_scopeN12Ast__scope_t1i(km_idx_0, &v_314, 0), _fx_catch_96);
      FX_CALL(_fx_cons_LN12Ast__scope_t(&v_314, sc_0, true, &try_sc_0), _fx_catch_96);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e1_11, 0, false, try_sc_0, &v_305, 0), _fx_catch_96);
      FX_COPY_PTR(v_305.t0, &e1_10);
      FX_COPY_PTR(v_305.t1, &body_code_5);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(e1_10, body_code_5, true, &v_306), _fx_catch_96);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_306, &e1loc_1, &try_body_0, 0),
         _fx_catch_96);
      _fx_R10Ast__loc_t exn_loc_0;
      if (cases_0 != 0) {
         FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(cases_0->hd.t0, &exn_loc_0, 0), _fx_catch_94);  _fx_catch_94: ;
      }
      else {
         exn_loc_0 = eloc_0;
      }
      FX_CHECK_EXN(_fx_catch_96);
      _fx_R9Ast__id_t exn_n_0;
      fx_str_t slit_34 = FX_MAKE_STR("exn");
      FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, &slit_34, &exn_n_0, 0), _fx_catch_96);
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g20K_normalize__KTypExn, &exn_loc_0, &v_307);
      FX_CALL(
         _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &_fx_g25K_normalize__IntrinPopExn, 0, &v_307, &pop_e_0), _fx_catch_96);
      _fx_N12Ast__scope_t v_315;
      FX_CALL(_fx_M3AstFM15new_block_scopeN12Ast__scope_t1i(km_idx_0, &v_315, 0), _fx_catch_96);
      FX_CALL(_fx_cons_LN12Ast__scope_t(&v_315, sc_0, true, &catch_sc_0), _fx_catch_96);
      FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_308, 0), _fx_catch_96);
      _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(pop_e_0, &v_309);
      FX_CALL(
         _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
            &exn_n_0, _fx_g20K_normalize__KTypExn, &v_308, &v_309, 0, &exn_loc_0, &catch_code_0, 0), _fx_catch_96);
      _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&exn_n_0, &v_310);
      FX_CALL(
         _fx_M11K_normalizeFM22transform_pat_matchingT2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t6N14K_form__atom_tLT2N10Ast__pat_tN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_tB(
            &v_310, cases_0, catch_code_0, catch_sc_0, &exn_loc_0, true, &v_311, 0), _fx_catch_96);
      FX_COPY_PTR(v_311.t0, &k_cases_1);
      FX_COPY_PTR(v_311.t1, &catch_code_1);
      if (k_cases_1 != 0) {
         if (k_cases_1->tl == 0) {
            _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* v_316 = &k_cases_1->hd;
            if (v_316->t0 == 0) {
               FX_COPY_PTR(v_316->t1, &handle_exn_0); goto _fx_endmatch_12;
            }
         }
      }
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_317 = {0};
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ktyp_0, &exn_loc_0, &v_317);
      FX_CALL(
         _fx_M6K_formFM9KExpMatchN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
            k_cases_1, &v_317, &handle_exn_0), _fx_catch_95);

   _fx_catch_95: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_317);

   _fx_endmatch_12: ;
      FX_CHECK_EXN(_fx_catch_96);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(handle_exn_0, catch_code_1, true, &v_312), _fx_catch_96);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_312, &exn_loc_0, &handle_exn_1, 0),
         _fx_catch_96);
      FX_CALL(
         _fx_M6K_formFM12KExpTryCatchN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
            try_body_0, handle_exn_1, &kctx_0, &v_313), _fx_catch_96);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_313, code_0, fx_result);

   _fx_catch_96: ;
      if (v_313) {
         _fx_free_N14K_form__kexp_t(&v_313);
      }
      if (handle_exn_1) {
         _fx_free_N14K_form__kexp_t(&handle_exn_1);
      }
      if (v_312) {
         _fx_free_LN14K_form__kexp_t(&v_312);
      }
      if (handle_exn_0) {
         _fx_free_N14K_form__kexp_t(&handle_exn_0);
      }
      if (catch_code_1) {
         _fx_free_LN14K_form__kexp_t(&catch_code_1);
      }
      if (k_cases_1) {
         _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&k_cases_1);
      }
      _fx_free_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t(&v_311);
      _fx_free_N14K_form__atom_t(&v_310);
      if (catch_code_0) {
         _fx_free_LN14K_form__kexp_t(&catch_code_0);
      }
      _fx_free_Nt6option1N14K_form__kexp_t(&v_309);
      _fx_free_R16Ast__val_flags_t(&v_308);
      FX_FREE_LIST_SIMPLE(&catch_sc_0);
      if (pop_e_0) {
         _fx_free_N14K_form__kexp_t(&pop_e_0);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_307);
      if (try_body_0) {
         _fx_free_N14K_form__kexp_t(&try_body_0);
      }
      if (v_306) {
         _fx_free_LN14K_form__kexp_t(&v_306);
      }
      if (body_code_5) {
         _fx_free_LN14K_form__kexp_t(&body_code_5);
      }
      if (e1_10) {
         _fx_free_N14K_form__kexp_t(&e1_10);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_305);
      FX_FREE_LIST_SIMPLE(&try_sc_0);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 34) {
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_318 = {0};
      _fx_N14K_form__kexp_t e2_11 = 0;
      _fx_LN14K_form__kexp_t code_73 = 0;
      _fx_N14K_form__ktyp_t ktyp_2 = 0;
      _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* vcase_31 = &e_0->u.DefVal;
      _fx_R16Ast__val_flags_t* flags_0 = &vcase_31->t2;
      _fx_N10Ast__pat_t p_0 = vcase_31->t0;
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            vcase_31->t1, code_0, true, sc_0, &v_318, 0), _fx_catch_99);
      FX_COPY_PTR(v_318.t0, &e2_11);
      FX_COPY_PTR(v_318.t1, &code_73);
      FX_CALL(_fx_M6K_formFM12get_kexp_typN14K_form__ktyp_t1N14K_form__kexp_t(e2_11, &ktyp_2, 0), _fx_catch_99);
      if (FX_REC_VARIANT_TAG(ktyp_2) == 7) {
         if (FX_REC_VARIANT_TAG(p_0) == 3) {
            _fx_R17K_form__kdefval_t dv_0 = {0};
            _fx_N15K_form__kinfo_t v_319 = {0};
            _fx_R9Ast__id_t* n_4 = &p_0->u.PatIdent.t0;
            fx_str_t slit_35 = FX_MAKE_STR("");
            _fx_make_R17K_form__kdefval_t(n_4, &slit_35, ktyp_2, flags_0, &eloc_0, &dv_0);
            _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(&dv_0, &v_319);
            FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(n_4, &v_319, 0), _fx_catch_97);
            _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(e2_11, code_73, fx_result);

         _fx_catch_97: ;
            _fx_free_N15K_form__kinfo_t(&v_319);
            _fx_free_R17K_form__kdefval_t(&dv_0);
            goto _fx_endmatch_13;
         }
      }
      _fx_Nt6option1N14K_form__kexp_t v_320 = {0};
      _fx_T2R9Ast__id_tLN14K_form__kexp_t v_321 = {0};
      _fx_LN14K_form__kexp_t code_74 = 0;
      _fx_N14K_form__kexp_t v_322 = 0;
      _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(e2_11, &v_320);
      fx_str_t slit_36 = FX_MAKE_STR("v");
      FX_CALL(
         _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
            p_0, ktyp_2, &v_320, code_73, &slit_36, flags_0, sc_0, &v_321, 0), _fx_catch_98);
      _fx_R9Ast__id_t v_323 = v_321.t0;
      FX_COPY_PTR(v_321.t1, &code_74);
      bool res_16;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&v_323, &_fx_g9Ast__noid, &res_16, 0), _fx_catch_98);
      if (res_16) {
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(e2_11, code_74, fx_result);
      }
      else {
         FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_322), _fx_catch_98);
         _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_322, code_74, fx_result);
      }

   _fx_catch_98: ;
      if (v_322) {
         _fx_free_N14K_form__kexp_t(&v_322);
      }
      if (code_74) {
         _fx_free_LN14K_form__kexp_t(&code_74);
      }
      _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_321);
      _fx_free_Nt6option1N14K_form__kexp_t(&v_320);

   _fx_endmatch_13: ;
      FX_CHECK_EXN(_fx_catch_99);

   _fx_catch_99: ;
      if (ktyp_2) {
         _fx_free_N14K_form__ktyp_t(&ktyp_2);
      }
      if (code_73) {
         _fx_free_LN14K_form__kexp_t(&code_73);
      }
      if (e2_11) {
         _fx_free_N14K_form__kexp_t(&e2_11);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_318);
      goto _fx_endmatch_14;
   }
   if (tag_0 == 35) {
      _fx_LN14K_form__kexp_t code_75 = 0;
      _fx_N14K_form__kexp_t v_324 = 0;
      FX_CALL(
         _fx_M11K_normalizeFM13transform_funLN14K_form__kexp_t3rR13Ast__deffun_tLN14K_form__kexp_tLN12Ast__scope_t(
            e_0->u.DefFun, code_0, sc_0, &code_75, 0), _fx_catch_100);
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_324), _fx_catch_100);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_324, code_75, fx_result);

   _fx_catch_100: ;
      if (v_324) {
         _fx_free_N14K_form__kexp_t(&v_324);
      }
      if (code_75) {
         _fx_free_LN14K_form__kexp_t(&code_75);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 37) {
      _fx_N14K_form__kexp_t v_325 = 0;
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_325), _fx_catch_101);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_325, code_0, fx_result);

   _fx_catch_101: ;
      if (v_325) {
         _fx_free_N14K_form__kexp_t(&v_325);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 38) {
      _fx_N14K_form__kexp_t v_326 = 0;
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_326), _fx_catch_102);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_326, code_0, fx_result);

   _fx_catch_102: ;
      if (v_326) {
         _fx_free_N14K_form__kexp_t(&v_326);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 36) {
      _fx_N14K_form__kexp_t v_327 = 0;
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_327), _fx_catch_103);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_327, code_0, fx_result);

   _fx_catch_103: ;
      if (v_327) {
         _fx_free_N14K_form__kexp_t(&v_327);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 39) {
      _fx_N14K_form__kexp_t v_328 = 0;
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_328), _fx_catch_104);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_328, code_0, fx_result);

   _fx_catch_104: ;
      if (v_328) {
         _fx_free_N14K_form__kexp_t(&v_328);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 40) {
      _fx_N14K_form__kexp_t v_329 = 0;
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_329), _fx_catch_105);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_329, code_0, fx_result);

   _fx_catch_105: ;
      if (v_329) {
         _fx_free_N14K_form__kexp_t(&v_329);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 41) {
      _fx_N14K_form__kexp_t v_330 = 0;
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_330), _fx_catch_106);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_330, code_0, fx_result);

   _fx_catch_106: ;
      if (v_330) {
         _fx_free_N14K_form__kexp_t(&v_330);
      }
      goto _fx_endmatch_14;
   }
   if (tag_0 == 42) {
      _fx_N14K_form__kexp_t v_331 = 0;
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&eloc_0, &v_331), _fx_catch_107);
      _fx_make_T2N14K_form__kexp_tLN14K_form__kexp_t(v_331, code_0, fx_result);

   _fx_catch_107: ;
      if (v_331) {
         _fx_free_N14K_form__kexp_t(&v_331);
      }
      goto _fx_endmatch_14;
   }
   FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);

_fx_endmatch_14: ;

_fx_cleanup: ;
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_0);
   if (etyp_0) {
      _fx_free_N10Ast__typ_t(&etyp_0);
   }
   if (ktyp_0) {
      _fx_free_N14K_form__ktyp_t(&ktyp_0);
   }
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&kctx_0);
   return fx_status;
}

static int
   _fx_M11K_normalizeFM13transform_forT4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t7LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tLN14K_form__kexp_tLN12Ast__scope_tLN12Ast__scope_tR10Ast__loc_ti(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* pe_l_0,
   struct _fx_N10Ast__pat_t_data_t* idx_pat_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_LN12Ast__scope_t_data_t* body_sc_0,
   struct _fx_R10Ast__loc_t* eloc_0,
   int_ km_idx_0,
   struct _fx_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t __fold_result___0 = {0};
   _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t v_0 = {0};
   _fx_LT2R9Ast__id_tN13K_form__dom_t idom_list_0 = 0;
   _fx_LN14K_form__kexp_t code_1 = 0;
   _fx_LN14K_form__kexp_t body_code_0 = 0;
   _fx_T2LR9Ast__id_tLN14K_form__kexp_t v_1 = {0};
   _fx_LR9Ast__id_t at_ids_0 = 0;
   _fx_LN14K_form__kexp_t body_code_1 = 0;
   _fx_LT2R9Ast__id_tN13K_form__dom_t __fold_result___1 = 0;
   _fx_LT2R9Ast__id_tN13K_form__dom_t v_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_make_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(0, code_0, 0, &__fold_result___0);
   _fx_LT2N10Ast__pat_tN10Ast__exp_t lst_0 = pe_l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N10Ast__pat_t pi_0 = 0;
      _fx_N10Ast__exp_t ei_0 = 0;
      _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t v_3 = {0};
      _fx_LT2R9Ast__id_tN13K_form__dom_t idom_list_1 = 0;
      _fx_LN14K_form__kexp_t code_2 = 0;
      _fx_LN14K_form__kexp_t body_code_2 = 0;
      _fx_T2N13K_form__dom_tLN14K_form__kexp_t v_4 = {0};
      _fx_N13K_form__dom_t di_0 = {0};
      _fx_LN14K_form__kexp_t code_3 = 0;
      _fx_N14K_form__ktyp_t ptyp_0 = 0;
      _fx_R16Ast__val_flags_t v_5 = {0};
      _fx_T2R9Ast__id_tLN14K_form__kexp_t v_6 = {0};
      _fx_LN14K_form__kexp_t body_code_3 = 0;
      _fx_T2R9Ast__id_tN13K_form__dom_t v_7 = {0};
      _fx_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t v_8 = {0};
      _fx_T2N10Ast__pat_tN10Ast__exp_t* __pat___0 = &lst_0->hd;
      FX_COPY_PTR(__pat___0->t0, &pi_0);
      FX_COPY_PTR(__pat___0->t1, &ei_0);
      _fx_copy_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(&__fold_result___0, &v_3);
      FX_COPY_PTR(v_3.t0, &idom_list_1);
      FX_COPY_PTR(v_3.t1, &code_2);
      FX_COPY_PTR(v_3.t2, &body_code_2);
      FX_CALL(
         _fx_M11K_normalizeFM7exp2domT2N13K_form__dom_tLN14K_form__kexp_t3N10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(ei_0,
            code_2, sc_0, &v_4, 0), _fx_catch_2);
      _fx_copy_N13K_form__dom_t(&v_4.t0, &di_0);
      FX_COPY_PTR(v_4.t1, &code_3);
      int tag_0 = di_0.tag;
      if (tag_0 == 3) {
         FX_COPY_PTR(_fx_g20K_normalize__KTypInt, &ptyp_0); goto _fx_endmatch_0;
      }
      bool res_0;
      if (tag_0 == 2) {
         res_0 = true;
      }
      else if (tag_0 == 1) {
         res_0 = true;
      }
      else {
         res_0 = false;
      }
      FX_CHECK_EXN(_fx_catch_2);
      if (res_0) {
         _fx_N14K_form__atom_t i_0 = {0};
         _fx_N14K_form__ktyp_t v_9 = 0;
         int tag_1 = di_0.tag;
         if (tag_1 == 2) {
            _fx_copy_N14K_form__atom_t(&di_0.u.DomainFast, &i_0);
         }
         else if (tag_1 == 1) {
            _fx_copy_N14K_form__atom_t(&di_0.u.DomainElem, &i_0);
         }
         else {
            _fx_N14K_form__klit_t v_10 = {0};
            _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(_fx_g21K_normalize__KTypVoid, &v_10);
            _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_10, &i_0);
            _fx_free_N14K_form__klit_t(&v_10);
         }
         FX_CHECK_EXN(_fx_catch_1);
         FX_CALL(_fx_M6K_formFM13get_atom_ktypN14K_form__ktyp_t2N14K_form__atom_tR10Ast__loc_t(&i_0, eloc_0, &v_9, 0),
            _fx_catch_1);
         int tag_2 = FX_REC_VARIANT_TAG(v_9);
         if (tag_2 == 17) {
            FX_COPY_PTR(v_9->u.KTypArray.t1, &ptyp_0);
         }
         else if (tag_2 == 19) {
            FX_COPY_PTR(v_9->u.KTypList, &ptyp_0);
         }
         else if (tag_2 == 18) {
            FX_COPY_PTR(v_9->u.KTypVector, &ptyp_0);
         }
         else if (tag_2 == 10) {
            FX_COPY_PTR(_fx_g21K_normalize__KTypChar, &ptyp_0);
         }
         else {
            fx_exn_t v_11 = {0};
            fx_str_t slit_0 = FX_MAKE_STR("unsupported type of the domain expression in for loop");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(eloc_0, &slit_0, &v_11, 0), _fx_catch_0);
            FX_THROW(&v_11, false, _fx_catch_0);

         _fx_catch_0: ;
            fx_free_exn(&v_11);
         }
         FX_CHECK_EXN(_fx_catch_1);

      _fx_catch_1: ;
         if (v_9) {
            _fx_free_N14K_form__ktyp_t(&v_9);
         }
         _fx_free_N14K_form__atom_t(&i_0);
         goto _fx_endmatch_0;
      }
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_2);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_2);
      FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_5, 0), _fx_catch_2);
      fx_str_t slit_1 = FX_MAKE_STR("i");
      FX_CALL(
         _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
            pi_0, ptyp_0, &_fx_g19K_normalize__None3_, body_code_2, &slit_1, &v_5, body_sc_0, &v_6, 0), _fx_catch_2);
      _fx_R9Ast__id_t i_1 = v_6.t0;
      FX_COPY_PTR(v_6.t1, &body_code_3);
      _fx_make_T2R9Ast__id_tN13K_form__dom_t(&i_1, &di_0, &v_7);
      FX_CALL(_fx_cons_LT2R9Ast__id_tN13K_form__dom_t(&v_7, idom_list_1, false, &idom_list_1), _fx_catch_2);
      _fx_make_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(idom_list_1, code_3, body_code_3, &v_8);
      _fx_free_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(&__fold_result___0);
      _fx_copy_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(&v_8, &__fold_result___0);

   _fx_catch_2: ;
      _fx_free_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(&v_8);
      _fx_free_T2R9Ast__id_tN13K_form__dom_t(&v_7);
      if (body_code_3) {
         _fx_free_LN14K_form__kexp_t(&body_code_3);
      }
      _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_6);
      _fx_free_R16Ast__val_flags_t(&v_5);
      if (ptyp_0) {
         _fx_free_N14K_form__ktyp_t(&ptyp_0);
      }
      if (code_3) {
         _fx_free_LN14K_form__kexp_t(&code_3);
      }
      _fx_free_N13K_form__dom_t(&di_0);
      _fx_free_T2N13K_form__dom_tLN14K_form__kexp_t(&v_4);
      if (body_code_2) {
         _fx_free_LN14K_form__kexp_t(&body_code_2);
      }
      if (code_2) {
         _fx_free_LN14K_form__kexp_t(&code_2);
      }
      if (idom_list_1) {
         _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&idom_list_1);
      }
      _fx_free_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(&v_3);
      if (ei_0) {
         _fx_free_N10Ast__exp_t(&ei_0);
      }
      if (pi_0) {
         _fx_free_N10Ast__pat_t(&pi_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(&__fold_result___0, &v_0);
   FX_COPY_PTR(v_0.t0, &idom_list_0);
   FX_COPY_PTR(v_0.t1, &code_1);
   FX_COPY_PTR(v_0.t2, &body_code_0);
   _fx_R10Ast__loc_t loc_0;
   FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(idx_pat_0, &loc_0, 0), _fx_cleanup);
   int tag_3 = FX_REC_VARIANT_TAG(idx_pat_0);
   if (tag_3 == 1) {
      _fx_make_T2LR9Ast__id_tLN14K_form__kexp_t(0, body_code_0, &v_1); goto _fx_endmatch_1;
   }
   if (tag_3 == 9) {
      _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* vcase_0 = &idx_pat_0->u.PatTyped;
      if (FX_REC_VARIANT_TAG(vcase_0->t1) == 5) {
         _fx_R16Ast__val_flags_t v_12 = {0};
         _fx_T2R9Ast__id_tLN14K_form__kexp_t v_13 = {0};
         _fx_LN14K_form__kexp_t body_code_4 = 0;
         _fx_LR9Ast__id_t v_14 = 0;
         FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_12, 0), _fx_catch_3);
         fx_str_t slit_2 = FX_MAKE_STR("i");
         FX_CALL(
            _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
               vcase_0->t0, _fx_g20K_normalize__KTypInt, &_fx_g19K_normalize__None3_, body_code_0, &slit_2, &v_12, body_sc_0,
               &v_13, 0), _fx_catch_3);
         _fx_R9Ast__id_t idx_0 = v_13.t0;
         FX_COPY_PTR(v_13.t1, &body_code_4);
         FX_CALL(_fx_cons_LR9Ast__id_t(&idx_0, 0, true, &v_14), _fx_catch_3);
         _fx_make_T2LR9Ast__id_tLN14K_form__kexp_t(v_14, body_code_4, &v_1);

      _fx_catch_3: ;
         FX_FREE_LIST_SIMPLE(&v_14);
         if (body_code_4) {
            _fx_free_LN14K_form__kexp_t(&body_code_4);
         }
         _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_13);
         _fx_free_R16Ast__val_flags_t(&v_12);
         goto _fx_endmatch_1;
      }
   }
   if (tag_3 == 9) {
      _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* vcase_1 = &idx_pat_0->u.PatTyped;
      _fx_N10Ast__typ_t v_15 = vcase_1->t1;
      if (FX_REC_VARIANT_TAG(v_15) == 17) {
         _fx_N10Ast__pat_t p_0 = 0;
         _fx_LN10Ast__typ_t tl_0 = v_15->u.TypTuple;
         FX_CALL(_fx_M3AstFM14pat_skip_typedN10Ast__pat_t1N10Ast__pat_t(vcase_1->t0, &p_0, 0), _fx_catch_16);
         int tag_4 = FX_REC_VARIANT_TAG(p_0);
         if (tag_4 == 4) {
            fx_exn_t v_16 = {0};
            _fx_T2LR9Ast__id_tLN14K_form__kexp_t __fold_result___2 = {0};
            _fx_LN10Ast__pat_t pl_0 = 0;
            _fx_LN10Ast__typ_t tl_1 = 0;
            _fx_T2LR9Ast__id_tLN14K_form__kexp_t v_17 = {0};
            _fx_LR9Ast__id_t at_ids_1 = 0;
            _fx_LN14K_form__kexp_t body_code_5 = 0;
            _fx_LR9Ast__id_t __fold_result___3 = 0;
            _fx_LR9Ast__id_t v_18 = 0;
            _fx_LN10Ast__pat_t pl_1 = p_0->u.PatTuple.t0;
            int_ v_19 = _fx_M11K_normalizeFM6lengthi1LN10Ast__pat_t(pl_1, 0);
            int_ v_20 = _fx_M11K_normalizeFM6lengthi1LN10Ast__typ_t(tl_0, 0);
            if (v_19 != v_20) {
               fx_str_t slit_3 = FX_MAKE_STR("the \'@\' tuple pattern and its type do not match");
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_3, &v_16, 0), _fx_catch_8);
               FX_THROW(&v_16, false, _fx_catch_8);
            }
            _fx_make_T2LR9Ast__id_tLN14K_form__kexp_t(0, body_code_0, &__fold_result___2);
            FX_COPY_PTR(pl_1, &pl_0);
            _fx_LN10Ast__pat_t lst_1 = pl_0;
            FX_COPY_PTR(tl_0, &tl_1);
            _fx_LN10Ast__typ_t lst_2 = tl_1;
            for (; lst_1 && lst_2; lst_2 = lst_2->tl, lst_1 = lst_1->tl) {
               _fx_T2LR9Ast__id_tLN14K_form__kexp_t v_21 = {0};
               _fx_LR9Ast__id_t at_ids_2 = 0;
               _fx_LN14K_form__kexp_t body_code_6 = 0;
               _fx_T2LR9Ast__id_tLN14K_form__kexp_t v_22 = {0};
               _fx_N10Ast__typ_t ti_0 = lst_2->hd;
               _fx_N10Ast__pat_t pi_1 = lst_1->hd;
               _fx_copy_T2LR9Ast__id_tLN14K_form__kexp_t(&__fold_result___2, &v_21);
               FX_COPY_PTR(v_21.t0, &at_ids_2);
               FX_COPY_PTR(v_21.t1, &body_code_6);
               if (FX_REC_VARIANT_TAG(ti_0) == 5) {
                  _fx_R16Ast__val_flags_t v_23 = {0};
                  _fx_T2R9Ast__id_tLN14K_form__kexp_t v_24 = {0};
                  _fx_LN14K_form__kexp_t body_code_7 = 0;
                  FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_23, 0), _fx_catch_4);
                  fx_str_t slit_4 = FX_MAKE_STR("i");
                  FX_CALL(
                     _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
                        pi_1, _fx_g20K_normalize__KTypInt, &_fx_g19K_normalize__None3_, body_code_6, &slit_4, &v_23, body_sc_0,
                        &v_24, 0), _fx_catch_4);
                  _fx_R9Ast__id_t i_2 = v_24.t0;
                  FX_COPY_PTR(v_24.t1, &body_code_7);
                  FX_CALL(_fx_cons_LR9Ast__id_t(&i_2, at_ids_2, false, &at_ids_2), _fx_catch_4);
                  _fx_make_T2LR9Ast__id_tLN14K_form__kexp_t(at_ids_2, body_code_7, &v_22);

               _fx_catch_4: ;
                  if (body_code_7) {
                     _fx_free_LN14K_form__kexp_t(&body_code_7);
                  }
                  _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_24);
                  _fx_free_R16Ast__val_flags_t(&v_23);
               }
               else {
                  fx_exn_t v_25 = {0};
                  fx_str_t slit_5 = FX_MAKE_STR("some of \'@\' indices is not an integer");
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_5, &v_25, 0), _fx_catch_5);
                  FX_THROW(&v_25, false, _fx_catch_5);

               _fx_catch_5: ;
                  fx_free_exn(&v_25);
               }
               FX_CHECK_EXN(_fx_catch_6);
               _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&__fold_result___2);
               _fx_copy_T2LR9Ast__id_tLN14K_form__kexp_t(&v_22, &__fold_result___2);

            _fx_catch_6: ;
               _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&v_22);
               if (body_code_6) {
                  _fx_free_LN14K_form__kexp_t(&body_code_6);
               }
               FX_FREE_LIST_SIMPLE(&at_ids_2);
               _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&v_21);
               FX_CHECK_EXN(_fx_catch_8);
            }
            int s_0 = !lst_1 + !lst_2;
            FX_CHECK_EQ_SIZE(s_0 == 0 || s_0 == 2, _fx_catch_8);
            _fx_copy_T2LR9Ast__id_tLN14K_form__kexp_t(&__fold_result___2, &v_17);
            FX_COPY_PTR(v_17.t0, &at_ids_1);
            FX_COPY_PTR(v_17.t1, &body_code_5);
            _fx_LR9Ast__id_t lst_3 = at_ids_1;
            for (; lst_3; lst_3 = lst_3->tl) {
               _fx_LR9Ast__id_t r_0 = 0;
               _fx_R9Ast__id_t* a_0 = &lst_3->hd;
               FX_COPY_PTR(__fold_result___3, &r_0);
               FX_CALL(_fx_cons_LR9Ast__id_t(a_0, r_0, false, &r_0), _fx_catch_7);
               FX_FREE_LIST_SIMPLE(&__fold_result___3);
               FX_COPY_PTR(r_0, &__fold_result___3);

            _fx_catch_7: ;
               FX_FREE_LIST_SIMPLE(&r_0);
               FX_CHECK_EXN(_fx_catch_8);
            }
            FX_COPY_PTR(__fold_result___3, &v_18);
            _fx_make_T2LR9Ast__id_tLN14K_form__kexp_t(v_18, body_code_5, &v_1);

         _fx_catch_8: ;
            FX_FREE_LIST_SIMPLE(&v_18);
            FX_FREE_LIST_SIMPLE(&__fold_result___3);
            if (body_code_5) {
               _fx_free_LN14K_form__kexp_t(&body_code_5);
            }
            FX_FREE_LIST_SIMPLE(&at_ids_1);
            _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&v_17);
            if (tl_1) {
               _fx_free_LN10Ast__typ_t(&tl_1);
            }
            if (pl_0) {
               _fx_free_LN10Ast__pat_t(&pl_0);
            }
            _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&__fold_result___2);
            fx_free_exn(&v_16);
         }
         else if (tag_4 == 3) {
            fx_str_t prefix_0 = {0};
            _fx_T2LR9Ast__id_tLN14K_form__ktyp_t __fold_result___4 = {0};
            _fx_LN10Ast__typ_t tl_2 = 0;
            _fx_T2LR9Ast__id_tLN14K_form__ktyp_t v_26 = {0};
            _fx_LR9Ast__id_t at_ids_3 = 0;
            _fx_LN14K_form__ktyp_t ktl_0 = 0;
            _fx_N14K_form__ktyp_t ktyp_0 = 0;
            _fx_LR9Ast__id_t __fold_result___5 = 0;
            _fx_LR9Ast__id_t at_ids_4 = 0;
            _fx_R16Ast__val_flags_t v_27 = {0};
            _fx_LN14K_form__atom_t v_28 = 0;
            _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_29 = {0};
            _fx_N14K_form__kexp_t v_30 = 0;
            _fx_Nt6option1N14K_form__kexp_t v_31 = {0};
            _fx_LN14K_form__kexp_t body_code_8 = 0;
            _fx_R9Ast__id_t* idx_1 = &p_0->u.PatIdent.t0;
            FX_CALL(_fx_M3AstFM2ppS1RM4id_t(idx_1, &prefix_0, 0), _fx_catch_14);
            _fx_make_T2LR9Ast__id_tLN14K_form__ktyp_t(0, 0, &__fold_result___4);
            int_ idx_2 = 0;
            FX_COPY_PTR(tl_0, &tl_2);
            _fx_LN10Ast__typ_t lst_4 = tl_2;
            for (; lst_4; lst_4 = lst_4->tl, idx_2 += 1) {
               _fx_T2LR9Ast__id_tLN14K_form__ktyp_t v_32 = {0};
               _fx_LR9Ast__id_t at_ids_5 = 0;
               _fx_LN14K_form__ktyp_t ktl_1 = 0;
               _fx_T2LR9Ast__id_tLN14K_form__ktyp_t v_33 = {0};
               _fx_N10Ast__typ_t ti_1 = lst_4->hd;
               _fx_copy_T2LR9Ast__id_tLN14K_form__ktyp_t(&__fold_result___4, &v_32);
               FX_COPY_PTR(v_32.t0, &at_ids_5);
               FX_COPY_PTR(v_32.t1, &ktl_1);
               if (FX_REC_VARIANT_TAG(ti_1) == 5) {
                  fx_str_t v_34 = {0};
                  fx_str_t v_35 = {0};
                  _fx_R16Ast__val_flags_t v_36 = {0};
                  _fx_LN14K_form__kexp_t res_1 = 0;
                  FX_CALL(_fx_F6stringS1i(idx_2, &v_34, 0), _fx_catch_9);
                  {
                     const fx_str_t strs_0[] = { prefix_0, v_34 };
                     FX_CALL(fx_strjoin(0, 0, 0, strs_0, 2, &v_35), _fx_catch_9);
                  }
                  _fx_R9Ast__id_t i_3;
                  FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, &v_35, &i_3, 0), _fx_catch_9);
                  FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_36, 0), _fx_catch_9);
                  FX_CALL(
                     _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
                        &i_3, _fx_g20K_normalize__KTypInt, &v_36, &_fx_g19K_normalize__None3_, 0, &loc_0, &res_1, 0),
                     _fx_catch_9);
                  FX_CALL(_fx_cons_LR9Ast__id_t(&i_3, at_ids_5, false, &at_ids_5), _fx_catch_9);
                  FX_CALL(_fx_cons_LN14K_form__ktyp_t(_fx_g20K_normalize__KTypInt, ktl_1, false, &ktl_1), _fx_catch_9);
                  _fx_make_T2LR9Ast__id_tLN14K_form__ktyp_t(at_ids_5, ktl_1, &v_33);

               _fx_catch_9: ;
                  if (res_1) {
                     _fx_free_LN14K_form__kexp_t(&res_1);
                  }
                  _fx_free_R16Ast__val_flags_t(&v_36);
                  FX_FREE_STR(&v_35);
                  FX_FREE_STR(&v_34);
               }
               else {
                  fx_exn_t v_37 = {0};
                  fx_str_t slit_6 = FX_MAKE_STR("some of \'@\' indices is not an integer");
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_6, &v_37, 0), _fx_catch_10);
                  FX_THROW(&v_37, false, _fx_catch_10);

               _fx_catch_10: ;
                  fx_free_exn(&v_37);
               }
               FX_CHECK_EXN(_fx_catch_11);
               _fx_free_T2LR9Ast__id_tLN14K_form__ktyp_t(&__fold_result___4);
               _fx_copy_T2LR9Ast__id_tLN14K_form__ktyp_t(&v_33, &__fold_result___4);

            _fx_catch_11: ;
               _fx_free_T2LR9Ast__id_tLN14K_form__ktyp_t(&v_33);
               if (ktl_1) {
                  _fx_free_LN14K_form__ktyp_t(&ktl_1);
               }
               FX_FREE_LIST_SIMPLE(&at_ids_5);
               _fx_free_T2LR9Ast__id_tLN14K_form__ktyp_t(&v_32);
               FX_CHECK_EXN(_fx_catch_14);
            }
            _fx_copy_T2LR9Ast__id_tLN14K_form__ktyp_t(&__fold_result___4, &v_26);
            FX_COPY_PTR(v_26.t0, &at_ids_3);
            FX_COPY_PTR(v_26.t1, &ktl_0);
            FX_CALL(_fx_M6K_formFM9KTypTupleN14K_form__ktyp_t1LN14K_form__ktyp_t(ktl_0, &ktyp_0), _fx_catch_14);
            _fx_LR9Ast__id_t lst_5 = at_ids_3;
            for (; lst_5; lst_5 = lst_5->tl) {
               _fx_LR9Ast__id_t r_1 = 0;
               _fx_R9Ast__id_t* a_1 = &lst_5->hd;
               FX_COPY_PTR(__fold_result___5, &r_1);
               FX_CALL(_fx_cons_LR9Ast__id_t(a_1, r_1, false, &r_1), _fx_catch_12);
               FX_FREE_LIST_SIMPLE(&__fold_result___5);
               FX_COPY_PTR(r_1, &__fold_result___5);

            _fx_catch_12: ;
               FX_FREE_LIST_SIMPLE(&r_1);
               FX_CHECK_EXN(_fx_catch_14);
            }
            FX_COPY_PTR(__fold_result___5, &at_ids_4);
            FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_27, 0), _fx_catch_14);
            _fx_LN14K_form__atom_t lstend_0 = 0;
            _fx_LR9Ast__id_t lst_6 = at_ids_4;
            for (; lst_6; lst_6 = lst_6->tl) {
               _fx_N14K_form__atom_t res_2 = {0};
               _fx_R9Ast__id_t* i_4 = &lst_6->hd;
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(i_4, &res_2);
               _fx_LN14K_form__atom_t node_0 = 0;
               FX_CALL(_fx_cons_LN14K_form__atom_t(&res_2, 0, false, &node_0), _fx_catch_13);
               FX_LIST_APPEND(v_28, lstend_0, node_0);

            _fx_catch_13: ;
               _fx_free_N14K_form__atom_t(&res_2);
               FX_CHECK_EXN(_fx_catch_14);
            }
            _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ktyp_0, &loc_0, &v_29);
            FX_CALL(
               _fx_M6K_formFM11KExpMkTupleN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(v_28, &v_29,
                  &v_30), _fx_catch_14);
            _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(v_30, &v_31);
            FX_CALL(
               _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
                  idx_1, ktyp_0, &v_27, &v_31, body_code_0, &loc_0, &body_code_8, 0), _fx_catch_14);
            _fx_make_T2LR9Ast__id_tLN14K_form__kexp_t(at_ids_4, body_code_8, &v_1);

         _fx_catch_14: ;
            if (body_code_8) {
               _fx_free_LN14K_form__kexp_t(&body_code_8);
            }
            _fx_free_Nt6option1N14K_form__kexp_t(&v_31);
            if (v_30) {
               _fx_free_N14K_form__kexp_t(&v_30);
            }
            _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_29);
            if (v_28) {
               _fx_free_LN14K_form__atom_t(&v_28);
            }
            _fx_free_R16Ast__val_flags_t(&v_27);
            FX_FREE_LIST_SIMPLE(&at_ids_4);
            FX_FREE_LIST_SIMPLE(&__fold_result___5);
            if (ktyp_0) {
               _fx_free_N14K_form__ktyp_t(&ktyp_0);
            }
            if (ktl_0) {
               _fx_free_LN14K_form__ktyp_t(&ktl_0);
            }
            FX_FREE_LIST_SIMPLE(&at_ids_3);
            _fx_free_T2LR9Ast__id_tLN14K_form__ktyp_t(&v_26);
            if (tl_2) {
               _fx_free_LN10Ast__typ_t(&tl_2);
            }
            _fx_free_T2LR9Ast__id_tLN14K_form__ktyp_t(&__fold_result___4);
            FX_FREE_STR(&prefix_0);
         }
         else {
            fx_exn_t v_38 = {0};
            fx_str_t slit_7 =
               FX_MAKE_STR("\'@\' pattern is expected to be either an integer scalar or a tuple of integer scalars");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_7, &v_38, 0), _fx_catch_15);
            FX_THROW(&v_38, false, _fx_catch_15);

         _fx_catch_15: ;
            fx_free_exn(&v_38);
         }
         FX_CHECK_EXN(_fx_catch_16);

      _fx_catch_16: ;
         if (p_0) {
            _fx_free_N10Ast__pat_t(&p_0);
         }
         goto _fx_endmatch_1;
      }
   }
   fx_exn_t v_39 = {0};
   fx_str_t slit_8 = FX_MAKE_STR("\'@\' pattern is expected to be either an integer scalar or a tuple of integer scalars");
   FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_8, &v_39, 0), _fx_catch_17);
   FX_THROW(&v_39, false, _fx_catch_17);

_fx_catch_17: ;
   fx_free_exn(&v_39);

_fx_endmatch_1: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_1.t0, &at_ids_0);
   FX_COPY_PTR(v_1.t1, &body_code_1);
   _fx_LT2R9Ast__id_tN13K_form__dom_t lst_7 = idom_list_0;
   for (; lst_7; lst_7 = lst_7->tl) {
      _fx_LT2R9Ast__id_tN13K_form__dom_t r_2 = 0;
      _fx_T2R9Ast__id_tN13K_form__dom_t* a_2 = &lst_7->hd;
      FX_COPY_PTR(__fold_result___1, &r_2);
      FX_CALL(_fx_cons_LT2R9Ast__id_tN13K_form__dom_t(a_2, r_2, false, &r_2), _fx_catch_18);
      _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&__fold_result___1);
      FX_COPY_PTR(r_2, &__fold_result___1);

   _fx_catch_18: ;
      if (r_2) {
         _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&r_2);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___1, &v_2);
   _fx_make_T4LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tLN14K_form__kexp_tLN14K_form__kexp_t(v_2, at_ids_0, code_1, body_code_1,
      fx_result);

_fx_cleanup: ;
   _fx_free_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(&__fold_result___0);
   _fx_free_T3LT2R9Ast__id_tN13K_form__dom_tLN14K_form__kexp_tLN14K_form__kexp_t(&v_0);
   if (idom_list_0) {
      _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&idom_list_0);
   }
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   if (body_code_0) {
      _fx_free_LN14K_form__kexp_t(&body_code_0);
   }
   _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&v_1);
   FX_FREE_LIST_SIMPLE(&at_ids_0);
   if (body_code_1) {
      _fx_free_LN14K_form__kexp_t(&body_code_1);
   }
   if (__fold_result___1) {
      _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&__fold_result___1);
   }
   if (v_2) {
      _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&v_2);
   }
   return fx_status;
}

static int
   _fx_M11K_normalizeFM13process_rpartT2N14K_form__atom_tLN14K_form__kexp_t4Nt6option1N10Ast__exp_tLN14K_form__kexp_tN14K_form__atom_tLN12Ast__scope_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* e_opt_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_N14K_form__atom_t* defval_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if ((e_opt_0 != 0) + 1 == 2) {
      FX_CALL(
         _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e_opt_0->u.Some, code_0, false, sc_0, fx_result, 0), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(defval_0, code_0, fx_result);
   }

_fx_cleanup: ;
   return fx_status;
}

static int
   _fx_M11K_normalizeFM14cast_if_neededT2N14K_form__atom_tLN14K_form__kexp_t4N14K_form__atom_tLN14K_form__kexp_tR10Ast__loc_tLN12Ast__scope_t(
   struct _fx_N14K_form__atom_t* scalar_idx_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_N14K_form__ktyp_t v_0 = 0;
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM13get_atom_ktypN14K_form__ktyp_t2N14K_form__atom_tR10Ast__loc_t(scalar_idx_0, loc_0, &v_0, 0),
      _fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(v_0);
   bool res_0;
   if (tag_0 == 8) {
      res_0 = true;
   }
   else if (tag_0 == 4) {
      res_0 = true;
   }
   else if (tag_0 == 3) {
      res_0 = true;
   }
   else {
      res_0 = false;
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      _fx_N14K_form__kexp_t v_1 = 0;
      int_ v_2;
      FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &v_2, 0), _fx_catch_0);
      FX_CALL(
         _fx_M6K_formFM8KExpCastN14K_form__kexp_t3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(scalar_idx_0,
            _fx_g20K_normalize__KTypInt, loc_0, &v_1), _fx_catch_0);
      fx_str_t slit_0 = FX_MAKE_STR("idx");
      FX_CALL(
         _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(v_2, &slit_0, v_1,
            false, code_0, fx_result, 0), _fx_catch_0);

   _fx_catch_0: ;
      if (v_1) {
         _fx_free_N14K_form__kexp_t(&v_1);
      }
      goto _fx_endmatch_0;
   }
   _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(scalar_idx_0, code_0, fx_result);

_fx_endmatch_0: ;

_fx_cleanup: ;
   if (v_0) {
      _fx_free_N14K_form__ktyp_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   bool tref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_0 = {0};
   _fx_N14K_form__kexp_t e_1 = 0;
   _fx_LN14K_form__kexp_t code_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(e_0,
         code_0, tref_0, sc_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &e_1);
   FX_COPY_PTR(v_0.t1, &code_1);
   int_ v_1;
   FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &v_1, 0), _fx_cleanup);
   fx_str_t slit_0 = FX_MAKE_STR("v");
   FX_CALL(
      _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(v_1, &slit_0, e_1,
         tref_0, code_1, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_0);
   if (e_1) {
      _fx_free_N14K_form__kexp_t(&e_1);
   }
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM18arithm_subexp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   bool tref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_0 = {0};
   _fx_N14K_form__atom_t a_0 = {0};
   _fx_LN14K_form__kexp_t code_1 = 0;
   _fx_N14K_form__ktyp_t v_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_R10Ast__loc_t loc_0;
   FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_0, &loc_0, 0), _fx_cleanup);
   FX_CALL(
      _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(e_0,
         code_0, tref_0, sc_0, &v_0, 0), _fx_cleanup);
   _fx_copy_N14K_form__atom_t(&v_0.t0, &a_0);
   FX_COPY_PTR(v_0.t1, &code_1);
   FX_CALL(_fx_M6K_formFM13get_atom_ktypN14K_form__ktyp_t2N14K_form__atom_tR10Ast__loc_t(&a_0, &loc_0, &v_1, 0), _fx_cleanup);
   if (FX_REC_VARIANT_TAG(v_1) == 5) {
      if (v_1->u.KTypFloat == 16) {
         _fx_N14K_form__ktyp_t v_2 = 0;
         _fx_N14K_form__kexp_t v_3 = 0;
         int_ v_4;
         FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &v_4, 0), _fx_catch_0);
         FX_CALL(_fx_M6K_formFM9KTypFloatN14K_form__ktyp_t1i(32, &v_2), _fx_catch_0);
         FX_CALL(
            _fx_M6K_formFM8KExpCastN14K_form__kexp_t3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(&a_0, v_2, &loc_0, &v_3),
            _fx_catch_0);
         fx_str_t slit_0 = FX_MAKE_STR("v");
         FX_CALL(
            _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(v_4, &slit_0,
               v_3, tref_0, code_1, fx_result, 0), _fx_catch_0);

      _fx_catch_0: ;
         if (v_3) {
            _fx_free_N14K_form__kexp_t(&v_3);
         }
         if (v_2) {
            _fx_free_N14K_form__ktyp_t(&v_2);
         }
         goto _fx_endmatch_0;
      }
   }
   _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(&a_0, code_1, fx_result);

_fx_endmatch_0: ;

_fx_cleanup: ;
   _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_0);
   _fx_free_N14K_form__atom_t(&a_0);
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   if (v_1) {
      _fx_free_N14K_form__ktyp_t(&v_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM6exp2idT2R9Ast__id_tLN14K_form__kexp_t5N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_tS(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   bool tref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   fx_str_t* msg_0,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_0 = {0};
   _fx_N14K_form__atom_t a_0 = {0};
   _fx_LN14K_form__kexp_t code_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(e_0,
         code_0, tref_0, sc_0, &v_0, 0), _fx_cleanup);
   _fx_copy_N14K_form__atom_t(&v_0.t0, &a_0);
   FX_COPY_PTR(v_0.t1, &code_1);
   _fx_R10Ast__loc_t v_1;
   FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_0, &v_1, 0), _fx_cleanup);
   _fx_R9Ast__id_t v_2;
   FX_CALL(_fx_M6K_formFM7atom2idR9Ast__id_t3N14K_form__atom_tR10Ast__loc_tS(&a_0, &v_1, msg_0, &v_2, 0), _fx_cleanup);
   _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&v_2, code_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_0);
   _fx_free_N14K_form__atom_t(&a_0);
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM7exp2domT2N13K_form__dom_tLN14K_form__kexp_t3N10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2N13K_form__dom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (FX_REC_VARIANT_TAG(e_0) == 5) {
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_0 = {0};
      _fx_N14K_form__kexp_t ek_0 = 0;
      _fx_LN14K_form__kexp_t code_1 = 0;
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e_0, code_0, false, sc_0, &v_0, 0), _fx_catch_1);
      FX_COPY_PTR(v_0.t0, &ek_0);
      FX_COPY_PTR(v_0.t1, &code_1);
      if (FX_REC_VARIANT_TAG(ek_0) == 14) {
         _fx_LN14K_form__atom_t v_1 = ek_0->u.KExpMkTuple.t0;
         if (v_1 != 0) {
            _fx_LN14K_form__atom_t v_2 = v_1->tl;
            if (v_2 != 0) {
               _fx_LN14K_form__atom_t v_3 = v_2->tl;
               if (v_3 != 0) {
                  if (v_3->tl == 0) {
                     _fx_N13K_form__dom_t v_4 = {0};
                     _fx_M6K_formFM11DomainRangeN13K_form__dom_t3N14K_form__atom_tN14K_form__atom_tN14K_form__atom_t(&v_1->hd,
                        &v_2->hd, &v_3->hd, &v_4);
                     _fx_make_T2N13K_form__dom_tLN14K_form__kexp_t(&v_4, code_1, fx_result);
                     _fx_free_N13K_form__dom_t(&v_4);
                     goto _fx_endmatch_0;
                  }
               }
            }
         }
      }
      fx_exn_t v_5 = {0};
      _fx_R10Ast__loc_t v_6;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_0, &v_6, 0), _fx_catch_0);
      fx_str_t slit_0 = FX_MAKE_STR("the range was not converted to a 3-element tuple as expected");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&v_6, &slit_0, &v_5, 0), _fx_catch_0);
      FX_THROW(&v_5, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_5);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_1);

   _fx_catch_1: ;
      if (code_1) {
         _fx_free_LN14K_form__kexp_t(&code_1);
      }
      if (ek_0) {
         _fx_free_N14K_form__kexp_t(&ek_0);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_0);
   }
   else {
      _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_7 = {0};
      _fx_N14K_form__atom_t i_0 = {0};
      _fx_LN14K_form__kexp_t code_2 = 0;
      _fx_N13K_form__dom_t v_8 = {0};
      FX_CALL(
         _fx_M11K_normalizeFM8exp2atomT2N14K_form__atom_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e_0, code_0, false, sc_0, &v_7, 0), _fx_catch_2);
      _fx_copy_N14K_form__atom_t(&v_7.t0, &i_0);
      FX_COPY_PTR(v_7.t1, &code_2);
      _fx_M6K_formFM10DomainElemN13K_form__dom_t1N14K_form__atom_t(&i_0, &v_8);
      _fx_make_T2N13K_form__dom_tLN14K_form__kexp_t(&v_8, code_2, fx_result);

   _fx_catch_2: ;
      _fx_free_N13K_form__dom_t(&v_8);
      if (code_2) {
         _fx_free_LN14K_form__kexp_t(&code_2);
      }
      _fx_free_N14K_form__atom_t(&i_0);
      _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_7);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM9eseq2codeT2LN14K_form__kexp_tLT2SR10Ast__loc_t3LN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
   struct _fx_LN10Ast__exp_t_data_t* eseq_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t* fx_result,
   void* fx_fv)
{
   _fx_rLT2SR10Ast__loc_t pragmas_ref_0 = 0;
   _fx_LN14K_form__kexp_t code_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(_fx_make_rLT2SR10Ast__loc_t(0, &pragmas_ref_0), _fx_cleanup);
   FX_CALL(
      _fx_M11K_normalizeFM10knorm_eseqLN14K_form__kexp_t4LN10Ast__exp_tLN14K_form__kexp_trLT2SR10Ast__loc_tLN12Ast__scope_t(
         eseq_0, code_0, pragmas_ref_0, sc_0, &code_1, 0), _fx_cleanup);
   _fx_make_T2LN14K_form__kexp_tLT2SR10Ast__loc_t(code_1, pragmas_ref_0->data, fx_result);

_fx_cleanup: ;
   if (pragmas_ref_0) {
      _fx_free_rLT2SR10Ast__loc_t(&pragmas_ref_0);
   }
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   return fx_status;
}

static int
   _fx_M11K_normalizeFM10knorm_eseqLN14K_form__kexp_t4LN10Ast__exp_tLN14K_form__kexp_trLT2SR10Ast__loc_tLN12Ast__scope_t(
   struct _fx_LN10Ast__exp_t_data_t* eseq_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_rLT2SR10Ast__loc_t_data_t* pragmas_ref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__kexp_t result_0 = 0;
   _fx_LN10Ast__exp_t eseq_1 = 0;
   _fx_LN14K_form__kexp_t code_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_LT2SR10Ast__loc_t* pragmas_0 = &pragmas_ref_0->data;
   FX_COPY_PTR(eseq_0, &eseq_1);
   FX_COPY_PTR(code_0, &code_1);
   for (;;) {
      _fx_LN10Ast__exp_t eseq_2 = 0;
      _fx_LN14K_form__kexp_t code_2 = 0;
      FX_COPY_PTR(eseq_1, &eseq_2);
      FX_COPY_PTR(code_1, &code_2);
      if (eseq_2 != 0) {
         _fx_N10Ast__exp_t v_0 = eseq_2->hd;
         if (FX_REC_VARIANT_TAG(v_0) == 42) {
            _fx_LS prl_0 = 0;
            _fx_T2LSR10Ast__loc_t* vcase_0 = &v_0->u.DirPragma;
            FX_COPY_PTR(vcase_0->t0, &prl_0);
            _fx_LS lst_0 = prl_0;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_T2SR10Ast__loc_t v_1 = {0};
               _fx_LT2SR10Ast__loc_t v_2 = 0;
               fx_str_t* pr_0 = &lst_0->hd;
               _fx_make_T2SR10Ast__loc_t(pr_0, &vcase_0->t1, &v_1);
               FX_CALL(_fx_cons_LT2SR10Ast__loc_t(&v_1, *pragmas_0, true, &v_2), _fx_catch_0);
               _fx_free_LT2SR10Ast__loc_t(pragmas_0);
               FX_COPY_PTR(v_2, pragmas_0);

            _fx_catch_0: ;
               if (v_2) {
                  _fx_free_LT2SR10Ast__loc_t(&v_2);
               }
               _fx_free_T2SR10Ast__loc_t(&v_1);
               FX_CHECK_EXN(_fx_catch_1);
            }
            _fx_LN10Ast__exp_t* rest_0 = &eseq_2->tl;
            _fx_free_LN10Ast__exp_t(&eseq_1);
            FX_COPY_PTR(*rest_0, &eseq_1);
            _fx_free_LN14K_form__kexp_t(&code_1);
            FX_COPY_PTR(code_2, &code_1);

         _fx_catch_1: ;
            if (prl_0) {
               _fx_free_LS(&prl_0);
            }
            goto _fx_endmatch_0;
         }
      }
      if (eseq_2 != 0) {
         _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_3 = {0};
         _fx_N14K_form__kexp_t eki_0 = 0;
         _fx_LN14K_form__kexp_t code_3 = 0;
         _fx_LN14K_form__kexp_t code_4 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               eseq_2->hd, code_2, false, sc_0, &v_3, 0), _fx_catch_3);
         FX_COPY_PTR(v_3.t0, &eki_0);
         FX_COPY_PTR(v_3.t1, &code_3);
         if (FX_REC_VARIANT_TAG(eki_0) == 1) {
            FX_COPY_PTR(code_3, &code_4);
         }
         else {
            FX_CALL(_fx_cons_LN14K_form__kexp_t(eki_0, code_3, true, &code_4), _fx_catch_2);  _fx_catch_2: ;
         }
         FX_CHECK_EXN(_fx_catch_3);
         _fx_LN10Ast__exp_t* rest_1 = &eseq_2->tl;
         _fx_free_LN10Ast__exp_t(&eseq_1);
         FX_COPY_PTR(*rest_1, &eseq_1);
         _fx_free_LN14K_form__kexp_t(&code_1);
         FX_COPY_PTR(code_4, &code_1);

      _fx_catch_3: ;
         if (code_4) {
            _fx_free_LN14K_form__kexp_t(&code_4);
         }
         if (code_3) {
            _fx_free_LN14K_form__kexp_t(&code_3);
         }
         if (eki_0) {
            _fx_free_N14K_form__kexp_t(&eki_0);
         }
         _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_3);
         goto _fx_endmatch_0;
      }
      if (eseq_2 == 0) {
         _fx_free_LN14K_form__kexp_t(&result_0);
         FX_COPY_PTR(code_2, &result_0);
         FX_BREAK(_fx_catch_4);

      _fx_catch_4: ;
         goto _fx_endmatch_0;
      }
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_5);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_5);

   _fx_catch_5: ;
      if (code_2) {
         _fx_free_LN14K_form__kexp_t(&code_2);
      }
      if (eseq_2) {
         _fx_free_LN10Ast__exp_t(&eseq_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(result_0, fx_result);

_fx_cleanup: ;
   if (result_0) {
      _fx_free_LN14K_form__kexp_t(&result_0);
   }
   if (eseq_1) {
      _fx_free_LN10Ast__exp_t(&eseq_1);
   }
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM10__lambda__B1T2R9Ast__id_tN10Ast__pat_t(
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* arg0_0,
   bool* fx_result,
   void* fx_fv)
{
   _fx_N10Ast__pat_t pi_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(arg0_0->t1, &pi_0);
   FX_CALL(_fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(pi_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   if (pi_0) {
      _fx_free_N10Ast__pat_t(&pi_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   bool* fx_result,
   void* fx_fv)
{
   _fx_N10Ast__pat_t p_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   bool result_0 = 0;
   FX_COPY_PTR(p_0, &p_1);
   for (;;) {
      _fx_N10Ast__pat_t p_2 = 0;
      FX_COPY_PTR(p_1, &p_2);
      int tag_0 = FX_REC_VARIANT_TAG(p_2);
      bool res_0;
      if (tag_0 == 1) {
         res_0 = true;
      }
      else if (tag_0 == 2) {
         res_0 = true;
      }
      else {
         res_0 = false;
      }
      FX_CHECK_EXN(_fx_catch_11);
      if (res_0) {
         result_0 = false; FX_BREAK(_fx_catch_0);  _fx_catch_0: ; goto _fx_endmatch_0;
      }
      bool res_1;
      if (tag_0 == 3) {
         res_1 = true;
      }
      else if (tag_0 == 8) {
         res_1 = true;
      }
      else {
         res_1 = false;
      }
      FX_CHECK_EXN(_fx_catch_11);
      if (res_1) {
         result_0 = true; FX_BREAK(_fx_catch_1);  _fx_catch_1: ; goto _fx_endmatch_0;
      }
      if (tag_0 == 7) {
         _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* vcase_0 = &p_2->u.PatCons;
         bool res_2;
         FX_CALL(_fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(vcase_0->t0, &res_2, 0), _fx_catch_2);
         if (res_2) {
            result_0 = true; FX_BREAK(_fx_catch_2);
         }
         else {
            _fx_N10Ast__pat_t* p2_0 = &vcase_0->t1; _fx_free_N10Ast__pat_t(&p_1); FX_COPY_PTR(*p2_0, &p_1);
         }

      _fx_catch_2: ;
         goto _fx_endmatch_0;
      }
      if (tag_0 == 9) {
         _fx_N10Ast__pat_t* p_3 = &p_2->u.PatTyped.t0;
         _fx_free_N10Ast__pat_t(&p_1);
         FX_COPY_PTR(*p_3, &p_1);
         goto _fx_endmatch_0;
      }
      if (tag_0 == 4) {
         _fx_LN10Ast__pat_t pl_0 = 0;
         bool __fold_result___0 = false;
         FX_COPY_PTR(p_2->u.PatTuple.t0, &pl_0);
         _fx_LN10Ast__pat_t lst_0 = pl_0;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_N10Ast__pat_t a_0 = lst_0->hd;
            bool v_0;
            FX_CALL(_fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(a_0, &v_0, 0), _fx_catch_3);
            if (v_0) {
               __fold_result___0 = true; FX_BREAK(_fx_catch_3);
            }

         _fx_catch_3: ;
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_4);
         }
         result_0 = __fold_result___0;
         FX_BREAK(_fx_catch_4);

      _fx_catch_4: ;
         if (pl_0) {
            _fx_free_LN10Ast__pat_t(&pl_0);
         }
         goto _fx_endmatch_0;
      }
      if (tag_0 == 5) {
         _fx_LN10Ast__pat_t pl_1 = 0;
         bool __fold_result___1 = false;
         FX_COPY_PTR(p_2->u.PatVariant.t1, &pl_1);
         _fx_LN10Ast__pat_t lst_1 = pl_1;
         for (; lst_1; lst_1 = lst_1->tl) {
            _fx_N10Ast__pat_t a_1 = lst_1->hd;
            bool v_1;
            FX_CALL(_fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(a_1, &v_1, 0), _fx_catch_5);
            if (v_1) {
               __fold_result___1 = true; FX_BREAK(_fx_catch_5);
            }

         _fx_catch_5: ;
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_6);
         }
         result_0 = __fold_result___1;
         FX_BREAK(_fx_catch_6);

      _fx_catch_6: ;
         if (pl_1) {
            _fx_free_LN10Ast__pat_t(&pl_1);
         }
         goto _fx_endmatch_0;
      }
      if (tag_0 == 6) {
         _fx_LT2R9Ast__id_tN10Ast__pat_t ip_l_0 = 0;
         bool __fold_result___2 = false;
         FX_COPY_PTR(p_2->u.PatRecord.t1, &ip_l_0);
         _fx_LT2R9Ast__id_tN10Ast__pat_t lst_2 = ip_l_0;
         for (; lst_2; lst_2 = lst_2->tl) {
            _fx_T2R9Ast__id_tN10Ast__pat_t* a_2 = &lst_2->hd;
            bool v_2;
            FX_CALL(_fx_M11K_normalizeFM10__lambda__B1T2R9Ast__id_tN10Ast__pat_t(a_2, &v_2, 0), _fx_catch_7);
            if (v_2) {
               __fold_result___2 = true; FX_BREAK(_fx_catch_7);
            }

         _fx_catch_7: ;
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_8);
         }
         result_0 = __fold_result___2;
         FX_BREAK(_fx_catch_8);

      _fx_catch_8: ;
         if (ip_l_0) {
            _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&ip_l_0);
         }
         goto _fx_endmatch_0;
      }
      if (tag_0 == 12) {
         _fx_N10Ast__pat_t* p_4 = &p_2->u.PatRef.t0; _fx_free_N10Ast__pat_t(&p_1); FX_COPY_PTR(*p_4, &p_1); goto _fx_endmatch_0;
      }
      if (tag_0 == 10) {
         _fx_N10Ast__pat_t* p_5 = &p_2->u.PatWhen.t0;
         _fx_free_N10Ast__pat_t(&p_1);
         FX_COPY_PTR(*p_5, &p_1);
         goto _fx_endmatch_0;
      }
      if (tag_0 == 11) {
         _fx_LN10Ast__pat_t pl_2 = 0;
         bool __fold_result___3 = false;
         FX_COPY_PTR(p_2->u.PatAlt.t0, &pl_2);
         _fx_LN10Ast__pat_t lst_3 = pl_2;
         for (; lst_3; lst_3 = lst_3->tl) {
            _fx_N10Ast__pat_t a_3 = lst_3->hd;
            bool v_3;
            FX_CALL(_fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(a_3, &v_3, 0), _fx_catch_9);
            if (v_3) {
               __fold_result___3 = true; FX_BREAK(_fx_catch_9);
            }

         _fx_catch_9: ;
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_10);
         }
         result_0 = __fold_result___3;
         FX_BREAK(_fx_catch_10);

      _fx_catch_10: ;
         if (pl_2) {
            _fx_free_LN10Ast__pat_t(&pl_2);
         }
         goto _fx_endmatch_0;
      }
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_11);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_11);

   _fx_catch_11: ;
      if (p_2) {
         _fx_free_N10Ast__pat_t(&p_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   *fx_result = result_0;

_fx_cleanup: ;
   if (p_1) {
      _fx_free_N10Ast__pat_t(&p_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM18get_record_elems_kT2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t3Nt6option1R9Ast__id_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_Nt6option1R9Ast__id_t* vn_opt_0,
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t* fx_result,
   void* fx_fv)
{
   _fx_N14K_form__ktyp_t t_1 = 0;
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM10deref_ktypN14K_form__ktyp_t2N14K_form__ktyp_tR10Ast__loc_t(t_0, loc_0, &t_1, 0), _fx_cleanup);
   _fx_R9Ast__id_t input_vn_0;
   if (vn_opt_0->tag == 2) {
      FX_CALL(_fx_M3AstFM13get_bare_nameRM4id_t1RM4id_t(&vn_opt_0->u.Some, &input_vn_0, 0), _fx_catch_0);  _fx_catch_0: ;
   }
   else {
      input_vn_0 = _fx_g9Ast__noid;
   }
   FX_CHECK_EXN(_fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(t_1);
   if (tag_0 == 15) {
      _fx_T4R9Ast__id_tiN14K_form__ktyp_tB v_0 = {0};
      _fx_make_T4R9Ast__id_tiN14K_form__ktyp_tB(&_fx_g9Ast__noid, 0, t_1, false, &v_0);
      _fx_make_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t(&v_0, t_1->u.KTypRecord.t1, fx_result);
      _fx_free_T4R9Ast__id_tiN14K_form__ktyp_tB(&v_0);
   }
   else if (tag_0 == 16) {
      _fx_N15K_form__kinfo_t v_1 = {0};
      _fx_R21K_form__kdefvariant_t v_2 = {0};
      _fx_R9Ast__id_t* tn_0 = &t_1->u.KTypName;
      FX_CALL(_fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(tn_0, loc_0, &v_1, 0), _fx_catch_9);
      int tag_1 = v_1.tag;
      if (tag_1 == 5) {
         _fx_copy_R21K_form__kdefvariant_t(&v_1.u.KVariant->data, &v_2);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t v_3 = v_2.kvar_cases;
         if (v_3 != 0) {
            if (v_3->tl == 0) {
               _fx_T2R9Ast__id_tN14K_form__ktyp_t* v_4 = &v_3->hd;
               _fx_N14K_form__ktyp_t rectyp_0 = v_4->t1;
               if (FX_REC_VARIANT_TAG(rectyp_0) == 15) {
                  _fx_R9Ast__id_t* vn0_0 = &v_4->t0;
                  if (v_2.kvar_flags.var_flag_record) {
                     fx_str_t v_5 = {0};
                     fx_str_t v_6 = {0};
                     fx_str_t v_7 = {0};
                     fx_exn_t v_8 = {0};
                     _fx_T4R9Ast__id_tiN14K_form__ktyp_tB v_9 = {0};
                     bool res_0;
                     FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&input_vn_0, &_fx_g9Ast__noid, &res_0, 0), _fx_catch_1);
                     bool t_2;
                     if (!res_0) {
                        _fx_R9Ast__id_t v_10;
                        FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(vn0_0, &v_10, 0), _fx_catch_1);
                        bool res_1;
                        FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&input_vn_0, &v_10, &res_1, 0), _fx_catch_1);
                        t_2 = !res_1;
                     }
                     else {
                        t_2 = false;
                     }
                     if (t_2) {
                        FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&input_vn_0, &v_5, 0), _fx_catch_1);
                        FX_CALL(_fx_M3AstFM2ppS1RM4id_t(vn0_0, &v_6, 0), _fx_catch_1);
                        fx_str_t slit_0 = FX_MAKE_STR("mismatch in the record name: given \'");
                        fx_str_t slit_1 = FX_MAKE_STR("\', expected \'");
                        fx_str_t slit_2 = FX_MAKE_STR("\'");
                        {
                           const fx_str_t strs_0[] = { slit_0, v_5, slit_1, v_6, slit_2 };
                           FX_CALL(fx_strjoin(0, 0, 0, strs_0, 5, &v_7), _fx_catch_1);
                        }
                        FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_7, &v_8, 0), _fx_catch_1);
                        FX_THROW(&v_8, false, _fx_catch_1);
                     }
                     _fx_make_T4R9Ast__id_tiN14K_form__ktyp_tB(&_fx_g9Ast__noid, 1, rectyp_0, false, &v_9);
                     _fx_make_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t(&v_9, rectyp_0->u.KTypRecord.t1,
                        fx_result);

                  _fx_catch_1: ;
                     _fx_free_T4R9Ast__id_tiN14K_form__ktyp_tB(&v_9);
                     fx_free_exn(&v_8);
                     FX_FREE_STR(&v_7);
                     FX_FREE_STR(&v_6);
                     FX_FREE_STR(&v_5);
                     goto _fx_endmatch_3;
                  }
               }
            }
         }
      }
      if (tag_1 == 5) {
         _fx_R21K_form__kdefvariant_t v_11 = {0};
         _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t __fold_result___0 = {0};
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_0 = 0;
         _fx_LR9Ast__id_t kvar_ctors_0 = 0;
         _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t __fold_result___1 = {0};
         _fx_copy_R21K_form__kdefvariant_t(&v_1.u.KVariant->data, &v_11);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_1 = v_11.kvar_cases;
         bool single_case_0;
         if (kvar_cases_1 != 0) {
            if (kvar_cases_1->tl == 0) {
               single_case_0 = true; goto _fx_endmatch_0;
            }
         }
         single_case_0 = false;

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_7);
         _fx_copy_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&_fx_g19K_normalize__None1_, &__fold_result___0);
         int_ i_0 = 0;
         FX_COPY_PTR(kvar_cases_1, &kvar_cases_0);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_0 = kvar_cases_0;
         FX_COPY_PTR(v_11.kvar_ctors, &kvar_ctors_0);
         _fx_LR9Ast__id_t lst_1 = kvar_ctors_0;
         for (; lst_0 && lst_1; lst_1 = lst_1->tl, lst_0 = lst_0->tl, i_0 += 1) {
            _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t v_12 = {0};
            _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t v_13 = {0};
            _fx_R9Ast__id_t* c_id_0 = &lst_1->hd;
            _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___0 = &lst_0->hd;
            _fx_R9Ast__id_t vn_0 = __pat___0->t0;
            _fx_R9Ast__id_t v_14;
            FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(&vn_0, &v_14, 0), _fx_catch_2);
            bool res_2;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&v_14, &input_vn_0, &res_2, 0), _fx_catch_2);
            bool t_3;
            if (res_2) {
               t_3 = true;
            }
            else if (single_case_0) {
               FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&input_vn_0, &_fx_g9Ast__noid, &t_3, 0), _fx_catch_2);
            }
            else {
               t_3 = false;
            }
            if (t_3) {
               _fx_make_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(__pat___0, i_0, c_id_0, &v_12);
               _fx_M11K_normalizeFM4SomeNt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(
                  &v_12, &v_13);
               _fx_free_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&__fold_result___0);
               _fx_copy_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&v_13, &__fold_result___0);
               FX_BREAK(_fx_catch_2);
            }

         _fx_catch_2: ;
            _fx_free_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&v_13);
            _fx_free_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&v_12);
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_7);
         }
         int s_0 = !lst_0 + !lst_1;
         FX_CHECK_EQ_SIZE(s_0 == 0 || s_0 == 2, _fx_catch_7);
         _fx_copy_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&__fold_result___0, &__fold_result___1);
         if (__fold_result___1.tag == 2) {
            _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* v_15 = &__fold_result___1.u.Some;
            _fx_N14K_form__ktyp_t v_16 = v_15->t0.t1;
            if (FX_REC_VARIANT_TAG(v_16) == 15) {
               _fx_N14K_form__ktyp_t rectyp_1 = 0;
               _fx_T4R9Ast__id_tiN14K_form__ktyp_tB v_17 = {0};
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t relems_0 = v_16->u.KTypRecord.t1;
               if (relems_0 != 0) {
                  if (relems_0->tl == 0) {
                     FX_COPY_PTR(relems_0->hd.t1, &rectyp_1); goto _fx_endmatch_1;
                  }
               }
               _fx_LN14K_form__ktyp_t v_18 = 0;
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t relems_1 = 0;
               _fx_LN14K_form__ktyp_t lstend_0 = 0;
               FX_COPY_PTR(relems_0, &relems_1);
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_2 = relems_1;
               for (; lst_2; lst_2 = lst_2->tl) {
                  _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___1 = &lst_2->hd;
                  _fx_LN14K_form__ktyp_t node_0 = 0;
                  FX_CALL(_fx_cons_LN14K_form__ktyp_t(__pat___1->t1, 0, false, &node_0), _fx_catch_3);
                  FX_LIST_APPEND(v_18, lstend_0, node_0);

               _fx_catch_3: ;
                  FX_CHECK_EXN(_fx_catch_4);
               }
               FX_CALL(_fx_M6K_formFM9KTypTupleN14K_form__ktyp_t1LN14K_form__ktyp_t(v_18, &rectyp_1), _fx_catch_4);

            _fx_catch_4: ;
               if (relems_1) {
                  _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&relems_1);
               }
               if (v_18) {
                  _fx_free_LN14K_form__ktyp_t(&v_18);
               }

            _fx_endmatch_1: ;
               FX_CHECK_EXN(_fx_catch_5);
               int_ v_19 = _fx_M11K_normalizeFM6lengthi1LT2R9Ast__id_tN14K_form__ktyp_t(kvar_cases_1, 0);
               _fx_make_T4R9Ast__id_tiN14K_form__ktyp_tB(&v_15->t2, v_15->t1 + 1, rectyp_1, v_19 > 1, &v_17);
               _fx_make_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t(&v_17, relems_0, fx_result);

            _fx_catch_5: ;
               _fx_free_T4R9Ast__id_tiN14K_form__ktyp_tB(&v_17);
               if (rectyp_1) {
                  _fx_free_N14K_form__ktyp_t(&rectyp_1);
               }
               goto _fx_endmatch_2;
            }
         }
         fx_str_t v_20 = {0};
         fx_str_t v_21 = {0};
         fx_exn_t v_22 = {0};
         FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&input_vn_0, &v_20, 0), _fx_catch_6);
         fx_str_t slit_3 = FX_MAKE_STR("tag \'");
         fx_str_t slit_4 = FX_MAKE_STR("\' is not found or is not a record");
         {
            const fx_str_t strs_1[] = { slit_3, v_20, slit_4 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_21), _fx_catch_6);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_21, &v_22, 0), _fx_catch_6);
         FX_THROW(&v_22, false, _fx_catch_6);

      _fx_catch_6: ;
         fx_free_exn(&v_22);
         FX_FREE_STR(&v_21);
         FX_FREE_STR(&v_20);

      _fx_endmatch_2: ;
         FX_CHECK_EXN(_fx_catch_7);

      _fx_catch_7: ;
         _fx_free_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&__fold_result___1);
         FX_FREE_LIST_SIMPLE(&kvar_ctors_0);
         if (kvar_cases_0) {
            _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kvar_cases_0);
         }
         _fx_free_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&__fold_result___0);
         _fx_free_R21K_form__kdefvariant_t(&v_11);
         goto _fx_endmatch_3;
      }
      fx_str_t v_23 = {0};
      fx_str_t v_24 = {0};
      fx_exn_t v_25 = {0};
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(tn_0, &v_23, 0), _fx_catch_8);
      fx_str_t slit_5 = FX_MAKE_STR("type \'");
      fx_str_t slit_6 = FX_MAKE_STR("\' is expected to be a variant");
      {
         const fx_str_t strs_2[] = { slit_5, v_23, slit_6 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_2, 3, &v_24), _fx_catch_8);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_24, &v_25, 0), _fx_catch_8);
      FX_THROW(&v_25, false, _fx_catch_8);

   _fx_catch_8: ;
      fx_free_exn(&v_25);
      FX_FREE_STR(&v_24);
      FX_FREE_STR(&v_23);

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_9);

   _fx_catch_9: ;
      _fx_free_R21K_form__kdefvariant_t(&v_2);
      _fx_free_N15K_form__kinfo_t(&v_1);
   }
   else {
      fx_exn_t v_26 = {0};
      fx_str_t slit_7 = FX_MAKE_STR("k-norm: attempt to treat non-record and non-variant as a record");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_7, &v_26, 0), _fx_catch_10);
      FX_THROW(&v_26, false, _fx_catch_10);

   _fx_catch_10: ;
      fx_free_exn(&v_26);
   }

_fx_cleanup: ;
   if (t_1) {
      _fx_free_N14K_form__ktyp_t(&t_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM16match_record_patT2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti2N10Ast__pat_tN14K_form__ktyp_t(
   struct _fx_N10Ast__pat_t_data_t* pat_0,
   struct _fx_N14K_form__ktyp_t_data_t* ptyp_0,
   struct _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (FX_REC_VARIANT_TAG(pat_0) == 6) {
      _fx_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t v_0 = {0};
      _fx_N14K_form__ktyp_t t_0 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t relems_found_0 = 0;
      _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti __fold_result___0 = 0;
      _fx_LT2R9Ast__id_tN10Ast__pat_t relems_0 = 0;
      _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti typed_rec_pl_0 = 0;
      _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB v_1 = {0};
      _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* vcase_0 = &pat_0->u.PatRecord;
      _fx_R10Ast__loc_t* loc_0 = &vcase_0->t2;
      _fx_Nt6option1R9Ast__id_t* rn_opt_0 = &vcase_0->t0;
      FX_CALL(
         _fx_M11K_normalizeFM18get_record_elems_kT2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t3Nt6option1R9Ast__id_tN14K_form__ktyp_tR10Ast__loc_t(
            rn_opt_0, ptyp_0, loc_0, &v_0, 0), _fx_catch_2);
      _fx_T4R9Ast__id_tiN14K_form__ktyp_tB* v_2 = &v_0.t0;
      _fx_R9Ast__id_t ctor_0 = v_2->t0;
      int_ case_i_0 = v_2->t1;
      FX_COPY_PTR(v_2->t2, &t_0);
      bool multiple_cases_0 = v_2->t3;
      FX_COPY_PTR(v_0.t1, &relems_found_0);
      FX_COPY_PTR(vcase_0->t1, &relems_0);
      _fx_LT2R9Ast__id_tN10Ast__pat_t lst_0 = relems_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_N10Ast__pat_t pi_0 = 0;
         _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti typed_rec_pl_1 = 0;
         _fx_T2iN14K_form__ktyp_t __fold_result___1 = {0};
         _fx_T2iN14K_form__ktyp_t v_3 = {0};
         _fx_N14K_form__ktyp_t found_t_0 = 0;
         fx_str_t v_4 = {0};
         fx_str_t v_5 = {0};
         fx_str_t v_6 = {0};
         fx_exn_t v_7 = {0};
         _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti v_8 = {0};
         _fx_T2R9Ast__id_tN10Ast__pat_t* __pat___0 = &lst_0->hd;
         _fx_R9Ast__id_t ni_0 = __pat___0->t0;
         FX_COPY_PTR(__pat___0->t1, &pi_0);
         FX_COPY_PTR(__fold_result___0, &typed_rec_pl_1);
         _fx_R9Ast__id_t ni_orig_0;
         FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(&ni_0, &ni_orig_0, 0), _fx_catch_1);
         _fx_make_T2iN14K_form__ktyp_t(-1, _fx_g21K_normalize__KTypVoid, &__fold_result___1);
         int_ idx_0 = 0;
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_1 = relems_found_0;
         for (; lst_1; lst_1 = lst_1->tl, idx_0 += 1) {
            _fx_N14K_form__ktyp_t tj_0 = 0;
            _fx_T2iN14K_form__ktyp_t v_9 = {0};
            _fx_N14K_form__ktyp_t found_t_1 = 0;
            _fx_T2iN14K_form__ktyp_t v_10 = {0};
            _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___1 = &lst_1->hd;
            _fx_R9Ast__id_t nj_0 = __pat___1->t0;
            FX_COPY_PTR(__pat___1->t1, &tj_0);
            _fx_copy_T2iN14K_form__ktyp_t(&__fold_result___1, &v_9);
            FX_COPY_PTR(v_9.t1, &found_t_1);
            _fx_R9Ast__id_t v_11;
            FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(&nj_0, &v_11, 0), _fx_catch_0);
            bool res_0;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&v_11, &ni_orig_0, &res_0, 0), _fx_catch_0);
            if (res_0) {
               _fx_make_T2iN14K_form__ktyp_t(idx_0, tj_0, &v_10);
            }
            else {
               _fx_make_T2iN14K_form__ktyp_t(v_9.t0, found_t_1, &v_10);
            }
            _fx_free_T2iN14K_form__ktyp_t(&__fold_result___1);
            _fx_copy_T2iN14K_form__ktyp_t(&v_10, &__fold_result___1);

         _fx_catch_0: ;
            _fx_free_T2iN14K_form__ktyp_t(&v_10);
            if (found_t_1) {
               _fx_free_N14K_form__ktyp_t(&found_t_1);
            }
            _fx_free_T2iN14K_form__ktyp_t(&v_9);
            if (tj_0) {
               _fx_free_N14K_form__ktyp_t(&tj_0);
            }
            FX_CHECK_EXN(_fx_catch_1);
         }
         _fx_copy_T2iN14K_form__ktyp_t(&__fold_result___1, &v_3);
         int_ found_idx_0 = v_3.t0;
         FX_COPY_PTR(v_3.t1, &found_t_0);
         if (found_idx_0 < 0) {
            FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&ni_0, &v_4, 0), _fx_catch_1);
            _fx_R9Ast__id_t v_12;
            if (rn_opt_0->tag == 2) {
               v_12 = rn_opt_0->u.Some;
            }
            else {
               v_12 = _fx_g9Ast__noid;
            }
            FX_CHECK_EXN(_fx_catch_1);
            FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&v_12, &v_5, 0), _fx_catch_1);
            fx_str_t slit_0 = FX_MAKE_STR("element \'");
            fx_str_t slit_1 = FX_MAKE_STR("\' is not found in the record \'");
            fx_str_t slit_2 = FX_MAKE_STR("\'");
            {
               const fx_str_t strs_0[] = { slit_0, v_4, slit_1, v_5, slit_2 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_0, 5, &v_6), _fx_catch_1);
            }
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_6, &v_7, 0), _fx_catch_1);
            FX_THROW(&v_7, false, _fx_catch_1);
         }
         _fx_make_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&ni_0, pi_0, found_t_0, found_idx_0, &v_8);
         FX_CALL(_fx_cons_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&v_8, typed_rec_pl_1, false, &typed_rec_pl_1),
            _fx_catch_1);
         _fx_free_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&__fold_result___0);
         FX_COPY_PTR(typed_rec_pl_1, &__fold_result___0);

      _fx_catch_1: ;
         _fx_free_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&v_8);
         fx_free_exn(&v_7);
         FX_FREE_STR(&v_6);
         FX_FREE_STR(&v_5);
         FX_FREE_STR(&v_4);
         if (found_t_0) {
            _fx_free_N14K_form__ktyp_t(&found_t_0);
         }
         _fx_free_T2iN14K_form__ktyp_t(&v_3);
         _fx_free_T2iN14K_form__ktyp_t(&__fold_result___1);
         if (typed_rec_pl_1) {
            _fx_free_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&typed_rec_pl_1);
         }
         if (pi_0) {
            _fx_free_N10Ast__pat_t(&pi_0);
         }
         FX_CHECK_EXN(_fx_catch_2);
      }
      FX_COPY_PTR(__fold_result___0, &typed_rec_pl_0);
      int_ v_13 = _fx_M11K_normalizeFM6lengthi1LT2R9Ast__id_tN14K_form__ktyp_t(relems_found_0, 0);
      _fx_make_T5R9Ast__id_tiN14K_form__ktyp_tBB(&ctor_0, case_i_0, t_0, multiple_cases_0, v_13 > 1, &v_1);
      _fx_make_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&v_1, typed_rec_pl_0,
         fx_result);

   _fx_catch_2: ;
      _fx_free_T5R9Ast__id_tiN14K_form__ktyp_tBB(&v_1);
      if (typed_rec_pl_0) {
         _fx_free_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&typed_rec_pl_0);
      }
      if (relems_0) {
         _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&relems_0);
      }
      if (__fold_result___0) {
         _fx_free_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&__fold_result___0);
      }
      if (relems_found_0) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&relems_found_0);
      }
      if (t_0) {
         _fx_free_N14K_form__ktyp_t(&t_0);
      }
      _fx_free_T2T4R9Ast__id_tiN14K_form__ktyp_tBLT2R9Ast__id_tN14K_form__ktyp_t(&v_0);
   }
   else {
      fx_exn_t v_14 = {0};
      _fx_R10Ast__loc_t v_15;
      FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(pat_0, &v_15, 0), _fx_catch_3);
      fx_str_t slit_3 = FX_MAKE_STR("record (or sometimes an exception) is expected");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&v_15, &slit_3, &v_14, 0), _fx_catch_3);
      FX_THROW(&v_14, false, _fx_catch_3);

   _fx_catch_3: ;
      fx_free_exn(&v_14);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM17match_variant_patT2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t2N10Ast__pat_tN14K_form__ktyp_t(
   struct _fx_N10Ast__pat_t_data_t* pat_0,
   struct _fx_N14K_form__ktyp_t_data_t* ptyp_0,
   struct _fx_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (FX_REC_VARIANT_TAG(pat_0) == 5) {
      _fx_rR21K_form__kdefvariant_t v_0 = 0;
      _fx_LR9Ast__id_t kvar_ctors_0 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_0 = 0;
      _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t __fold_result___0 = {0};
      _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t __fold_result___1 = {0};
      _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* vcase_0 = &pat_0->u.PatVariant;
      _fx_R10Ast__loc_t* loc_0 = &vcase_0->t2;
      _fx_LN10Ast__pat_t pl_0 = vcase_0->t1;
      _fx_R9Ast__id_t* vn0_0 = &vcase_0->t0;
      FX_CALL(_fx_M6K_formFM12get_kvariantrRM13kdefvariant_t2N14K_form__ktyp_tR10Ast__loc_t(ptyp_0, loc_0, &v_0, 0),
         _fx_catch_5);
      _fx_R21K_form__kdefvariant_t* v_1 = &v_0->data;
      _fx_R10Ast__loc_t kvar_loc_0 = v_1->kvar_loc;
      FX_COPY_PTR(v_1->kvar_ctors, &kvar_ctors_0);
      FX_COPY_PTR(v_1->kvar_cases, &kvar_cases_0);
      _fx_copy_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&_fx_g19K_normalize__None1_, &__fold_result___0);
      int_ i_0 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_0 = kvar_cases_0;
      _fx_LR9Ast__id_t lst_1 = kvar_ctors_0;
      for (; lst_0 && lst_1; lst_1 = lst_1->tl, lst_0 = lst_0->tl, i_0 += 1) {
         _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t v_2 = {0};
         _fx_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t v_3 = {0};
         _fx_R9Ast__id_t* c_id_0 = &lst_1->hd;
         _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___0 = &lst_0->hd;
         _fx_R9Ast__id_t vn_0 = __pat___0->t0;
         _fx_R9Ast__id_t v_4;
         FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(&vn_0, &v_4, 0), _fx_catch_0);
         _fx_R9Ast__id_t v_5;
         FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(vn0_0, &v_5, 0), _fx_catch_0);
         bool res_0;
         FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&v_4, &v_5, &res_0, 0), _fx_catch_0);
         if (res_0) {
            _fx_make_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(__pat___0, i_0, c_id_0, &v_2);
            _fx_M11K_normalizeFM4SomeNt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(
               &v_2, &v_3);
            _fx_free_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&__fold_result___0);
            _fx_copy_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&v_3, &__fold_result___0);
            FX_BREAK(_fx_catch_0);
         }

      _fx_catch_0: ;
         _fx_free_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&v_3);
         _fx_free_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&v_2);
         FX_CHECK_BREAK();
         FX_CHECK_EXN(_fx_catch_5);
      }
      int s_0 = !lst_0 + !lst_1;
      FX_CHECK_EQ_SIZE(s_0 == 0 || s_0 == 2, _fx_catch_5);
      _fx_copy_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&__fold_result___0, &__fold_result___1);
      if (__fold_result___1.tag == 2) {
         _fx_LN14K_form__ktyp_t tl_0 = 0;
         fx_str_t v_6 = {0};
         fx_str_t v_7 = {0};
         fx_str_t v_8 = {0};
         fx_exn_t v_9 = {0};
         _fx_LT2N10Ast__pat_tN14K_form__ktyp_t typed_var_pl_0 = 0;
         _fx_LN10Ast__pat_t pl_1 = 0;
         _fx_T3R9Ast__id_tiN14K_form__ktyp_t v_10 = {0};
         _fx_T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t* v_11 = &__fold_result___1.u.Some;
         _fx_R9Ast__id_t* ctor_0 = &v_11->t2;
         _fx_N14K_form__ktyp_t t_0 = v_11->t0.t1;
         if (FX_REC_VARIANT_TAG(t_0) == 14) {
            FX_COPY_PTR(t_0->u.KTypTuple, &tl_0);
         }
         else {
            FX_CALL(_fx_cons_LN14K_form__ktyp_t(t_0, 0, true, &tl_0), _fx_catch_1);  _fx_catch_1: ;
         }
         FX_CHECK_EXN(_fx_catch_3);
         int_ v_12 = _fx_M11K_normalizeFM6lengthi1LN10Ast__pat_t(pl_0, 0);
         int_ v_13 = _fx_M11K_normalizeFM6lengthi1LN14K_form__ktyp_t(tl_0, 0);
         if (v_12 != v_13) {
            FX_CALL(_fx_M3AstFM2ppS1RM4id_t(ctor_0, &v_6, 0), _fx_catch_3);
            FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(&kvar_loc_0, &v_7, 0), _fx_catch_3);
            fx_str_t slit_0 = FX_MAKE_STR("the number of variant pattern arguments does not match the number of \'");
            fx_str_t slit_1 =
               FX_MAKE_STR("\' parameters.\n"
                  U"See ");
            {
               const fx_str_t strs_0[] = { slit_0, v_6, slit_1, v_7 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_0, 4, &v_8), _fx_catch_3);
            }
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_8, &v_9, 0), _fx_catch_3);
            FX_THROW(&v_9, false, _fx_catch_3);
         }
         _fx_LT2N10Ast__pat_tN14K_form__ktyp_t lstend_0 = 0;
         FX_COPY_PTR(pl_0, &pl_1);
         _fx_LN10Ast__pat_t lst_2 = pl_1;
         _fx_LN14K_form__ktyp_t lst_3 = tl_0;
         for (; lst_2 && lst_3; lst_3 = lst_3->tl, lst_2 = lst_2->tl) {
            _fx_T2N10Ast__pat_tN14K_form__ktyp_t tup_0 = {0};
            _fx_N14K_form__ktyp_t ti_0 = lst_3->hd;
            _fx_N10Ast__pat_t pi_0 = lst_2->hd;
            _fx_make_T2N10Ast__pat_tN14K_form__ktyp_t(pi_0, ti_0, &tup_0);
            _fx_LT2N10Ast__pat_tN14K_form__ktyp_t node_0 = 0;
            FX_CALL(_fx_cons_LT2N10Ast__pat_tN14K_form__ktyp_t(&tup_0, 0, false, &node_0), _fx_catch_2);
            FX_LIST_APPEND(typed_var_pl_0, lstend_0, node_0);

         _fx_catch_2: ;
            _fx_free_T2N10Ast__pat_tN14K_form__ktyp_t(&tup_0);
            FX_CHECK_EXN(_fx_catch_3);
         }
         int s_1 = !lst_2 + !lst_3;
         FX_CHECK_EQ_SIZE(s_1 == 0 || s_1 == 2, _fx_catch_3);
         _fx_make_T3R9Ast__id_tiN14K_form__ktyp_t(ctor_0, v_11->t1 + 1, t_0, &v_10);
         _fx_make_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t(&v_10, typed_var_pl_0, fx_result);

      _fx_catch_3: ;
         _fx_free_T3R9Ast__id_tiN14K_form__ktyp_t(&v_10);
         if (pl_1) {
            _fx_free_LN10Ast__pat_t(&pl_1);
         }
         if (typed_var_pl_0) {
            _fx_free_LT2N10Ast__pat_tN14K_form__ktyp_t(&typed_var_pl_0);
         }
         fx_free_exn(&v_9);
         FX_FREE_STR(&v_8);
         FX_FREE_STR(&v_7);
         FX_FREE_STR(&v_6);
         if (tl_0) {
            _fx_free_LN14K_form__ktyp_t(&tl_0);
         }
      }
      else {
         fx_str_t v_14 = {0};
         fx_str_t v_15 = {0};
         fx_exn_t v_16 = {0};
         FX_CALL(_fx_M3AstFM2ppS1RM4id_t(vn0_0, &v_14, 0), _fx_catch_4);
         fx_str_t slit_2 = FX_MAKE_STR("tag \'");
         fx_str_t slit_3 = FX_MAKE_STR("\' is not found or is not a record");
         {
            const fx_str_t strs_1[] = { slit_2, v_14, slit_3 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_15), _fx_catch_4);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_15, &v_16, 0), _fx_catch_4);
         FX_THROW(&v_16, false, _fx_catch_4);

      _fx_catch_4: ;
         fx_free_exn(&v_16);
         FX_FREE_STR(&v_15);
         FX_FREE_STR(&v_14);
      }
      FX_CHECK_EXN(_fx_catch_5);

   _fx_catch_5: ;
      _fx_free_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&__fold_result___1);
      _fx_free_Nt6option1T3T2R9Ast__id_tN14K_form__ktyp_tiR9Ast__id_t(&__fold_result___0);
      if (kvar_cases_0) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kvar_cases_0);
      }
      FX_FREE_LIST_SIMPLE(&kvar_ctors_0);
      if (v_0) {
         _fx_free_rR21K_form__kdefvariant_t(&v_0);
      }
   }
   else {
      fx_exn_t v_17 = {0};
      _fx_R10Ast__loc_t v_18;
      FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(pat_0, &v_18, 0), _fx_catch_6);
      fx_str_t slit_4 = FX_MAKE_STR("variant pattern is expected");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&v_18, &slit_4, &v_17, 0), _fx_catch_6);
      FX_THROW(&v_17, false, _fx_catch_6);

   _fx_catch_6: ;
      fx_free_exn(&v_17);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM15pat_need_checksB2N10Ast__pat_tN14K_form__ktyp_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   struct _fx_N14K_form__ktyp_t_data_t* ptyp_0,
   bool* fx_result,
   void* fx_fv)
{
   _fx_N10Ast__pat_t p_1 = 0;
   _fx_N14K_form__ktyp_t ptyp_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   bool result_0 = 0;
   FX_COPY_PTR(p_0, &p_1);
   FX_COPY_PTR(ptyp_0, &ptyp_1);
   for (;;) {
      _fx_N10Ast__pat_t p_2 = 0;
      _fx_N14K_form__ktyp_t ptyp_2 = 0;
      FX_COPY_PTR(p_1, &p_2);
      FX_COPY_PTR(ptyp_1, &ptyp_2);
      int tag_0 = FX_REC_VARIANT_TAG(p_2);
      bool res_0;
      if (tag_0 == 1) {
         res_0 = true;
      }
      else if (tag_0 == 3) {
         res_0 = true;
      }
      else if (tag_0 == 8) {
         res_0 = true;
      }
      else {
         res_0 = false;
      }
      FX_CHECK_EXN(_fx_catch_19);
      if (res_0) {
         result_0 = false; FX_BREAK(_fx_catch_0);  _fx_catch_0: ; goto _fx_endmatch_0;
      }
      if (tag_0 == 2) {
         result_0 = true; FX_BREAK(_fx_catch_1);  _fx_catch_1: ; goto _fx_endmatch_0;
      }
      if (tag_0 == 7) {
         result_0 = true; FX_BREAK(_fx_catch_2);  _fx_catch_2: ; goto _fx_endmatch_0;
      }
      if (tag_0 == 9) {
         _fx_N10Ast__pat_t* p_3 = &p_2->u.PatTyped.t0;
         _fx_free_N10Ast__pat_t(&p_1);
         FX_COPY_PTR(*p_3, &p_1);
         _fx_free_N14K_form__ktyp_t(&ptyp_1);
         FX_COPY_PTR(ptyp_2, &ptyp_1);
         goto _fx_endmatch_0;
      }
      if (tag_0 == 4) {
         _fx_LN14K_form__ktyp_t tl_0 = 0;
         _fx_LN10Ast__pat_t pl_0 = 0;
         _fx_T2LN10Ast__pat_tR10Ast__loc_t* vcase_0 = &p_2->u.PatTuple;
         if (FX_REC_VARIANT_TAG(ptyp_2) == 14) {
            FX_COPY_PTR(ptyp_2->u.KTypTuple, &tl_0);
         }
         else {
            fx_exn_t v_0 = {0};
            fx_str_t slit_0 = FX_MAKE_STR("this pattern needs a tuple as argument");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&vcase_0->t1, &slit_0, &v_0, 0), _fx_catch_3);
            FX_THROW(&v_0, false, _fx_catch_3);

         _fx_catch_3: ;
            fx_free_exn(&v_0);
         }
         FX_CHECK_EXN(_fx_catch_5);
         bool __fold_result___0 = false;
         FX_COPY_PTR(vcase_0->t0, &pl_0);
         _fx_LN10Ast__pat_t lst_0 = pl_0;
         _fx_LN14K_form__ktyp_t lst_1 = tl_0;
         for (; lst_0 && lst_1; lst_1 = lst_1->tl, lst_0 = lst_0->tl) {
            _fx_N14K_form__ktyp_t ti_0 = lst_1->hd;
            _fx_N10Ast__pat_t pi_0 = lst_0->hd;
            bool v_1;
            FX_CALL(_fx_M11K_normalizeFM15pat_need_checksB2N10Ast__pat_tN14K_form__ktyp_t(pi_0, ti_0, &v_1, 0), _fx_catch_4);
            if (v_1) {
               __fold_result___0 = true; FX_BREAK(_fx_catch_4);
            }

         _fx_catch_4: ;
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_5);
         }
         int s_0 = !lst_0 + !lst_1;
         FX_CHECK_EQ_SIZE(s_0 == 0 || s_0 == 2, _fx_catch_5);
         result_0 = __fold_result___0;
         FX_BREAK(_fx_catch_5);

      _fx_catch_5: ;
         if (pl_0) {
            _fx_free_LN10Ast__pat_t(&pl_0);
         }
         if (tl_0) {
            _fx_free_LN14K_form__ktyp_t(&tl_0);
         }
         goto _fx_endmatch_0;
      }
      if (tag_0 == 5) {
         fx_exn_t exn_0 = {0};
         _fx_R10Ast__loc_t* loc_0 = &p_2->u.PatVariant.t2;
         bool result_1;
         _fx_rR21K_form__kdefvariant_t v_2 = 0;
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_0 = 0;
         _fx_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t v_3 = {0};
         _fx_LT2N10Ast__pat_tN14K_form__ktyp_t typed_var_pl_0 = 0;
         FX_CALL(_fx_M6K_formFM12get_kvariantrRM13kdefvariant_t2N14K_form__ktyp_tR10Ast__loc_t(ptyp_2, loc_0, &v_2, 0),
            _fx_catch_7);
         FX_COPY_PTR(v_2->data.kvar_cases, &kvar_cases_0);
         int_ v_4 = _fx_M11K_normalizeFM6lengthi1LT2R9Ast__id_tN14K_form__ktyp_t(kvar_cases_0, 0);
         if (v_4 > 1) {
            result_1 = true;
         }
         else {
            FX_CALL(
               _fx_M11K_normalizeFM17match_variant_patT2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t2N10Ast__pat_tN14K_form__ktyp_t(
                  p_2, ptyp_2, &v_3, 0), _fx_catch_7);
            FX_COPY_PTR(v_3.t1, &typed_var_pl_0);
            bool __fold_result___1 = false;
            _fx_LT2N10Ast__pat_tN14K_form__ktyp_t lst_2 = typed_var_pl_0;
            for (; lst_2; lst_2 = lst_2->tl) {
               _fx_N10Ast__pat_t p_4 = 0;
               _fx_N14K_form__ktyp_t t_0 = 0;
               _fx_T2N10Ast__pat_tN14K_form__ktyp_t* __pat___0 = &lst_2->hd;
               FX_COPY_PTR(__pat___0->t0, &p_4);
               FX_COPY_PTR(__pat___0->t1, &t_0);
               bool v_5;
               FX_CALL(_fx_M11K_normalizeFM15pat_need_checksB2N10Ast__pat_tN14K_form__ktyp_t(p_4, t_0, &v_5, 0), _fx_catch_6);
               if (v_5) {
                  __fold_result___1 = true; FX_BREAK(_fx_catch_6);
               }

            _fx_catch_6: ;
               if (t_0) {
                  _fx_free_N14K_form__ktyp_t(&t_0);
               }
               if (p_4) {
                  _fx_free_N10Ast__pat_t(&p_4);
               }
               FX_CHECK_BREAK();
               FX_CHECK_EXN(_fx_catch_7);
            }
            result_1 = __fold_result___1;
         }

      _fx_catch_7: ;
         if (v_2) {
            _fx_free_rR21K_form__kdefvariant_t(&v_2);
         }
         if (kvar_cases_0) {
            _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kvar_cases_0);
         }
         _fx_free_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t(&v_3);
         if (typed_var_pl_0) {
            _fx_free_LT2N10Ast__pat_tN14K_form__ktyp_t(&typed_var_pl_0);
         }
         if (fx_status < 0) {
            fx_exn_get_and_reset(fx_status, &exn_0);
            fx_status = 0;
            if (exn_0.tag == _FX_EXN_E17Ast__CompileError) {
               _fx_N14K_form__ktyp_t v_6 = 0;
               FX_CALL(_fx_M6K_formFM10deref_ktypN14K_form__ktyp_t2N14K_form__ktyp_tR10Ast__loc_t(ptyp_2, loc_0, &v_6, 0),
                  _fx_catch_8);
               if (FX_REC_VARIANT_TAG(v_6) == 21) {
                  result_1 = true;
               }
               else {
                  FX_THROW(&exn_0, false, _fx_catch_8);
               }
               FX_CHECK_EXN(_fx_catch_8);

            _fx_catch_8: ;
               if (v_6) {
                  _fx_free_N14K_form__ktyp_t(&v_6);
               }
            }
            else {
               FX_RETHROW(&exn_0, _fx_catch_9);
            }
            FX_CHECK_EXN(_fx_catch_9);
         }
         result_0 = result_1;
         FX_BREAK(_fx_catch_9);

      _fx_catch_9: ;
         fx_free_exn(&exn_0);
         goto _fx_endmatch_0;
      }
      if (tag_0 == 6) {
         fx_exn_t exn_1 = {0};
         bool result_2;
         _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti v_7 = {0};
         _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti typed_rec_pl_0 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM16match_record_patT2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti2N10Ast__pat_tN14K_form__ktyp_t(
               p_2, ptyp_2, &v_7, 0), _fx_catch_11);
         bool multiple_cases_0 = v_7.t0.t3;
         FX_COPY_PTR(v_7.t1, &typed_rec_pl_0);
         if (multiple_cases_0) {
            result_2 = true;
         }
         else {
            bool __fold_result___2 = false;
            _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti lst_3 = typed_rec_pl_0;
            for (; lst_3; lst_3 = lst_3->tl) {
               _fx_N10Ast__pat_t pi_1 = 0;
               _fx_N14K_form__ktyp_t ti_1 = 0;
               _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* __pat___1 = &lst_3->hd;
               FX_COPY_PTR(__pat___1->t1, &pi_1);
               FX_COPY_PTR(__pat___1->t2, &ti_1);
               bool v_8;
               FX_CALL(_fx_M11K_normalizeFM15pat_need_checksB2N10Ast__pat_tN14K_form__ktyp_t(pi_1, ti_1, &v_8, 0),
                  _fx_catch_10);
               if (v_8) {
                  __fold_result___2 = true; FX_BREAK(_fx_catch_10);
               }

            _fx_catch_10: ;
               if (ti_1) {
                  _fx_free_N14K_form__ktyp_t(&ti_1);
               }
               if (pi_1) {
                  _fx_free_N10Ast__pat_t(&pi_1);
               }
               FX_CHECK_BREAK();
               FX_CHECK_EXN(_fx_catch_11);
            }
            result_2 = __fold_result___2;
         }

      _fx_catch_11: ;
         _fx_free_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&v_7);
         if (typed_rec_pl_0) {
            _fx_free_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&typed_rec_pl_0);
         }
         if (fx_status < 0) {
            fx_exn_get_and_reset(fx_status, &exn_1);
            fx_status = 0;
            if (exn_1.tag == _FX_EXN_E17Ast__CompileError) {
               _fx_N14K_form__ktyp_t v_9 = 0;
               FX_CALL(
                  _fx_M6K_formFM10deref_ktypN14K_form__ktyp_t2N14K_form__ktyp_tR10Ast__loc_t(ptyp_2, &p_2->u.PatRecord.t2, &v_9,
                     0), _fx_catch_12);
               if (FX_REC_VARIANT_TAG(v_9) == 21) {
                  result_2 = true;
               }
               else {
                  FX_THROW(&exn_1, false, _fx_catch_12);
               }
               FX_CHECK_EXN(_fx_catch_12);

            _fx_catch_12: ;
               if (v_9) {
                  _fx_free_N14K_form__ktyp_t(&v_9);
               }
            }
            else {
               FX_RETHROW(&exn_1, _fx_catch_13);
            }
            FX_CHECK_EXN(_fx_catch_13);
         }
         result_0 = result_2;
         FX_BREAK(_fx_catch_13);

      _fx_catch_13: ;
         fx_free_exn(&exn_1);
         goto _fx_endmatch_0;
      }
      if (tag_0 == 12) {
         _fx_N14K_form__ktyp_t t_1 = 0;
         _fx_T2N10Ast__pat_tR10Ast__loc_t* vcase_1 = &p_2->u.PatRef;
         if (FX_REC_VARIANT_TAG(ptyp_2) == 20) {
            FX_COPY_PTR(ptyp_2->u.KTypRef, &t_1);
         }
         else {
            fx_exn_t v_10 = {0};
            fx_str_t slit_1 = FX_MAKE_STR("this pattern needs a reference as argument");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&vcase_1->t1, &slit_1, &v_10, 0), _fx_catch_14);
            FX_THROW(&v_10, false, _fx_catch_14);

         _fx_catch_14: ;
            fx_free_exn(&v_10);
         }
         FX_CHECK_EXN(_fx_catch_15);
         _fx_N10Ast__pat_t* p_5 = &vcase_1->t0;
         _fx_free_N10Ast__pat_t(&p_1);
         FX_COPY_PTR(*p_5, &p_1);
         _fx_free_N14K_form__ktyp_t(&ptyp_1);
         FX_COPY_PTR(t_1, &ptyp_1);

      _fx_catch_15: ;
         if (t_1) {
            _fx_free_N14K_form__ktyp_t(&t_1);
         }
         goto _fx_endmatch_0;
      }
      if (tag_0 == 10) {
         result_0 = true; FX_BREAK(_fx_catch_16);  _fx_catch_16: ; goto _fx_endmatch_0;
      }
      if (tag_0 == 11) {
         _fx_LN10Ast__pat_t pl_1 = 0;
         bool __fold_result___3 = false;
         FX_COPY_PTR(p_2->u.PatAlt.t0, &pl_1);
         _fx_LN10Ast__pat_t lst_4 = pl_1;
         for (; lst_4; lst_4 = lst_4->tl) {
            _fx_N10Ast__pat_t pi_2 = lst_4->hd;
            bool v_11;
            FX_CALL(_fx_M11K_normalizeFM15pat_need_checksB2N10Ast__pat_tN14K_form__ktyp_t(pi_2, ptyp_2, &v_11, 0),
               _fx_catch_17);
            if (v_11) {
               __fold_result___3 = true; FX_BREAK(_fx_catch_17);
            }

         _fx_catch_17: ;
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_18);
         }
         result_0 = __fold_result___3;
         FX_BREAK(_fx_catch_18);

      _fx_catch_18: ;
         if (pl_1) {
            _fx_free_LN10Ast__pat_t(&pl_1);
         }
         goto _fx_endmatch_0;
      }
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_19);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_19);

   _fx_catch_19: ;
      if (ptyp_2) {
         _fx_free_N14K_form__ktyp_t(&ptyp_2);
      }
      if (p_2) {
         _fx_free_N10Ast__pat_t(&p_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   *fx_result = result_0;

_fx_cleanup: ;
   if (p_1) {
      _fx_free_N10Ast__pat_t(&p_1);
   }
   if (ptyp_1) {
      _fx_free_N14K_form__ktyp_t(&ptyp_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM14pat_propose_idT4N10Ast__pat_tR9Ast__id_tBB6N10Ast__pat_tN14K_form__ktyp_tSBBLN12Ast__scope_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   struct _fx_N14K_form__ktyp_t_data_t* ptyp_0,
   fx_str_t* temp_prefix_0,
   bool is_simple_0,
   bool mutable_leaves_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T4N10Ast__pat_tR9Ast__id_tBB* fx_result,
   void* fx_fv)
{
   _fx_N10Ast__pat_t p_1 = 0;
   int fx_status = 0;
   int_ km_idx_0;
   FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &km_idx_0, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM14pat_skip_typedN10Ast__pat_t1N10Ast__pat_t(p_0, &p_1, 0), _fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(p_1);
   if (tag_0 == 1) {
      _fx_make_T4N10Ast__pat_tR9Ast__id_tBB(p_1, &_fx_g9Ast__noid, false, true, fx_result);
   }
   else if (tag_0 == 3) {
      _fx_make_T4N10Ast__pat_tR9Ast__id_tBB(p_1, &p_1->u.PatIdent.t0, false, false, fx_result);
   }
   else if (tag_0 == 8) {
      fx_exn_t v_0 = {0};
      _fx_N10Ast__pat_t v_1 = 0;
      _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* vcase_0 = &p_1->u.PatAs;
      if (mutable_leaves_0) {
         fx_str_t slit_0 = FX_MAKE_STR("\'as\' pattern cannot be used with var\'s, only with values");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&vcase_0->t2, &slit_0, &v_0, 0), _fx_catch_0);
         FX_THROW(&v_0, false, _fx_catch_0);
      }
      FX_CALL(_fx_M3AstFM14pat_skip_typedN10Ast__pat_t1N10Ast__pat_t(vcase_0->t0, &v_1, 0), _fx_catch_0);
      _fx_make_T4N10Ast__pat_tR9Ast__id_tBB(v_1, &vcase_0->t1, false, false, fx_result);

   _fx_catch_0: ;
      if (v_1) {
         _fx_free_N10Ast__pat_t(&v_1);
      }
      fx_free_exn(&v_0);
   }
   else if (tag_0 == 12) {
      bool v_2;
      bool res_0;
      FX_CALL(_fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(p_1, &res_0, 0), _fx_catch_1);
      if (res_0) {
         v_2 = true;
      }
      else if (!is_simple_0) {
         FX_CALL(_fx_M11K_normalizeFM15pat_need_checksB2N10Ast__pat_tN14K_form__ktyp_t(p_1, ptyp_0, &v_2, 0), _fx_catch_1);
      }
      else {
         v_2 = false;
      }
      if (v_2) {
         _fx_R9Ast__id_t v_3;
         FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, temp_prefix_0, &v_3, 0), _fx_catch_1);
         _fx_make_T4N10Ast__pat_tR9Ast__id_tBB(p_1, &v_3, false, true, fx_result);
      }
      else {
         _fx_make_T4N10Ast__pat_tR9Ast__id_tBB(p_1, &_fx_g9Ast__noid, false, true, fx_result);
      }

   _fx_catch_1: ;
   }
   else {
      bool v_4;
      bool res_1;
      FX_CALL(_fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(p_1, &res_1, 0), _fx_catch_2);
      if (res_1) {
         v_4 = true;
      }
      else if (!is_simple_0) {
         FX_CALL(_fx_M11K_normalizeFM15pat_need_checksB2N10Ast__pat_tN14K_form__ktyp_t(p_1, ptyp_0, &v_4, 0), _fx_catch_2);
      }
      else {
         v_4 = false;
      }
      if (v_4) {
         _fx_R9Ast__id_t v_5;
         FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, temp_prefix_0, &v_5, 0), _fx_catch_2);
         _fx_make_T4N10Ast__pat_tR9Ast__id_tBB(p_1, &v_5, true, true, fx_result);
      }
      else {
         _fx_make_T4N10Ast__pat_tR9Ast__id_tBB(p_1, &_fx_g9Ast__noid, false, true, fx_result);
      }

   _fx_catch_2: ;
   }

_fx_cleanup: ;
   if (p_1) {
      _fx_free_N10Ast__pat_t(&p_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   struct _fx_N14K_form__ktyp_t_data_t* ptyp_0,
   struct _fx_Nt6option1N14K_form__kexp_t* e_opt_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   fx_str_t* temp_prefix_0,
   struct _fx_R16Ast__val_flags_t* flags_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LN14K_form__atom_tB v_0 = {0};
   _fx_LN14K_form__atom_t tup_elems_0 = 0;
   _fx_R16Ast__val_flags_t n_flags_0 = {0};
   _fx_T4N10Ast__pat_tR9Ast__id_tBB v_1 = {0};
   _fx_N10Ast__pat_t p_1 = 0;
   _fx_R16Ast__val_flags_t n_flags_1 = {0};
   _fx_R16Ast__val_flags_t n_flags_2 = {0};
   _fx_LN14K_form__kexp_t code_1 = 0;
   _fx_LN14K_form__kexp_t code_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int_ km_idx_0;
   FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &km_idx_0, 0), _fx_cleanup);
   int tag_0 = e_opt_0->tag;
   if (tag_0 == 2) {
      _fx_N14K_form__kexp_t e_0 = e_opt_0->u.Some;
      int tag_1 = FX_REC_VARIANT_TAG(e_0);
      bool res_0;
      if (tag_1 == 8) {
         res_0 = true; goto _fx_endmatch_0;
      }
      if (tag_1 == 19) {
         res_0 = true; goto _fx_endmatch_0;
      }
      if (tag_1 == 20) {
         res_0 = true; goto _fx_endmatch_0;
      }
      if (tag_1 == 7) {
         if (e_0->u.KExpUnary.t0.tag == 7) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      res_0 = false;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_0);
      if (res_0) {
         _fx_make_T2LN14K_form__atom_tB(0, true, &v_0); goto _fx_endmatch_1;
      }
      if (tag_1 == 14) {
         _fx_make_T2LN14K_form__atom_tB(e_0->u.KExpMkTuple.t0, false, &v_0); goto _fx_endmatch_1;
      }
      _fx_make_T2LN14K_form__atom_tB(0, false, &v_0);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_0);

   _fx_catch_0: ;
   }
   else if (tag_0 == 1) {
      _fx_make_T2LN14K_form__atom_tB(0, true, &v_0);
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_0.t0, &tup_elems_0);
   bool need_tref_0 = v_0.t1;
   bool mutable_leaves_0 = flags_0->val_flag_mutable;
   _fx_make_R16Ast__val_flags_t(flags_0->val_flag_arg, false, flags_0->val_flag_temp, false, flags_0->val_flag_private,
      flags_0->val_flag_subarray, flags_0->val_flag_instance, &flags_0->val_flag_method, flags_0->val_flag_ctor,
      flags_0->val_flag_global, &n_flags_0);
   FX_CALL(
      _fx_M11K_normalizeFM14pat_propose_idT4N10Ast__pat_tR9Ast__id_tBB6N10Ast__pat_tN14K_form__ktyp_tSBBLN12Ast__scope_t(p_0,
         ptyp_0, temp_prefix_0, true, mutable_leaves_0, sc_0, &v_1, 0), _fx_cleanup);
   FX_COPY_PTR(v_1.t0, &p_1);
   _fx_R9Ast__id_t n_0 = v_1.t1;
   bool tref_0 = v_1.t2;
   bool tmp_0 = v_1.t3;
   bool tref_1;
   if (tref_0) {
      tref_1 = need_tref_0;
   }
   else {
      tref_1 = false;
   }
   bool res_1;
   FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&n_0, &_fx_g9Ast__noid, &res_1, 0), _fx_cleanup);
   if (res_1) {
      _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&n_0, code_0, fx_result);
   }
   else {
      _fx_R10Ast__loc_t loc_0;
      FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(p_1, &loc_0, 0), _fx_cleanup);
      bool t_0;
      if (mutable_leaves_0) {
         t_0 = !tref_1;
      }
      else {
         t_0 = false;
      }
      if (t_0) {
         _fx_make_R16Ast__val_flags_t(n_flags_0.val_flag_arg, true, n_flags_0.val_flag_temp, n_flags_0.val_flag_tempref,
            n_flags_0.val_flag_private, n_flags_0.val_flag_subarray, n_flags_0.val_flag_instance, &n_flags_0.val_flag_method,
            n_flags_0.val_flag_ctor, n_flags_0.val_flag_global, &n_flags_1);
      }
      else if (tref_1) {
         _fx_make_R16Ast__val_flags_t(n_flags_0.val_flag_arg, n_flags_0.val_flag_mutable, n_flags_0.val_flag_temp, true,
            n_flags_0.val_flag_private, n_flags_0.val_flag_subarray, n_flags_0.val_flag_instance, &n_flags_0.val_flag_method,
            n_flags_0.val_flag_ctor, n_flags_0.val_flag_global, &n_flags_1);
      }
      else if (tmp_0) {
         _fx_make_R16Ast__val_flags_t(n_flags_0.val_flag_arg, n_flags_0.val_flag_mutable, true, n_flags_0.val_flag_tempref,
            n_flags_0.val_flag_private, n_flags_0.val_flag_subarray, n_flags_0.val_flag_instance, &n_flags_0.val_flag_method,
            n_flags_0.val_flag_ctor, n_flags_0.val_flag_global, &n_flags_1);
      }
      else {
         _fx_copy_R16Ast__val_flags_t(&n_flags_0, &n_flags_1);
      }
      if (sc_0 != 0) {
         if (sc_0->hd.tag == 10) {
            _fx_make_R16Ast__val_flags_t(n_flags_1.val_flag_arg, n_flags_1.val_flag_mutable, n_flags_1.val_flag_temp,
               n_flags_1.val_flag_tempref, n_flags_1.val_flag_private, n_flags_1.val_flag_subarray, n_flags_1.val_flag_instance,
               &n_flags_1.val_flag_method, n_flags_1.val_flag_ctor, sc_0, &n_flags_2);
            goto _fx_endmatch_2;
         }
      }
      _fx_copy_R16Ast__val_flags_t(&n_flags_1, &n_flags_2);

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_cleanup);
      FX_CALL(
         _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
            &n_0, ptyp_0, &n_flags_2, e_opt_0, code_0, &loc_0, &code_1, 0), _fx_cleanup);
      int tag_2 = FX_REC_VARIANT_TAG(p_1);
      if (tag_2 == 4) {
         _fx_LN14K_form__ktyp_t tl_0 = 0;
         _fx_LN14K_form__kexp_t __fold_result___0 = 0;
         _fx_LN10Ast__pat_t pl_0 = 0;
         _fx_T2LN10Ast__pat_tR10Ast__loc_t* vcase_0 = &p_1->u.PatTuple;
         _fx_R10Ast__loc_t* loc_1 = &vcase_0->t1;
         _fx_LN10Ast__pat_t pl_1 = vcase_0->t0;
         if (FX_REC_VARIANT_TAG(ptyp_0) == 14) {
            fx_exn_t v_2 = {0};
            _fx_LN14K_form__ktyp_t tl_1 = ptyp_0->u.KTypTuple;
            int_ v_3;
            FX_CALL(_fx_M11K_normalizeFM8length1_i1LN14K_form__ktyp_t(tl_1, &v_3, 0), _fx_catch_1);
            int_ v_4;
            FX_CALL(_fx_M11K_normalizeFM8length1_i1LN10Ast__pat_t(pl_1, &v_4, 0), _fx_catch_1);
            if (v_3 != v_4) {
               fx_str_t slit_0 = FX_MAKE_STR("the number of elements in the pattern and in the tuple type are different");
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_1, &slit_0, &v_2, 0), _fx_catch_1);
               FX_THROW(&v_2, false, _fx_catch_1);
            }
            else {
               FX_COPY_PTR(tl_1, &tl_0);
            }

         _fx_catch_1: ;
            fx_free_exn(&v_2);
         }
         else {
            fx_exn_t v_5 = {0};
            fx_str_t slit_1 = FX_MAKE_STR("invalid type of the tuple pattern (it must be a tuple as well)");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_1, &slit_1, &v_5, 0), _fx_catch_2);
            FX_THROW(&v_5, false, _fx_catch_2);

         _fx_catch_2: ;
            fx_free_exn(&v_5);
         }
         FX_CHECK_EXN(_fx_catch_4);
         FX_COPY_PTR(code_1, &__fold_result___0);
         int_ idx_0 = 0;
         FX_COPY_PTR(pl_1, &pl_0);
         _fx_LN10Ast__pat_t lst_0 = pl_0;
         _fx_LN14K_form__ktyp_t lst_1 = tl_0;
         for (; lst_0 && lst_1; lst_1 = lst_1->tl, lst_0 = lst_0->tl, idx_0 += 1) {
            _fx_LN14K_form__kexp_t code_3 = 0;
            _fx_N14K_form__kexp_t ei_0 = 0;
            _fx_N14K_form__atom_t v_6 = {0};
            _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_7 = {0};
            _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_8 = {0};
            _fx_Nt6option1N14K_form__kexp_t v_9 = {0};
            _fx_T2R9Ast__id_tLN14K_form__kexp_t v_10 = {0};
            _fx_LN14K_form__kexp_t v_11 = 0;
            _fx_N14K_form__ktyp_t ti_0 = lst_1->hd;
            _fx_N10Ast__pat_t pi_0 = lst_0->hd;
            FX_COPY_PTR(__fold_result___0, &code_3);
            _fx_R10Ast__loc_t loci_0;
            FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(pi_0, &loci_0, 0), _fx_catch_3);
            if (tup_elems_0 != 0) {
               FX_CALL(_fx_M11K_normalizeFM3nthN14K_form__atom_t2LN14K_form__atom_ti(tup_elems_0, idx_0, &v_6, 0), _fx_catch_3);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ti_0, loc_1, &v_7);
               FX_CALL(
                  _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_6, &v_7, &ei_0),
                  _fx_catch_3);
            }
            else {
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ti_0, &loci_0, &v_8);
               FX_CALL(
                  _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&n_0, idx_0, &v_8,
                     &ei_0), _fx_catch_3);
            }
            _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(ei_0, &v_9);
            FX_CALL(
               _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
                  pi_0, ti_0, &v_9, code_3, temp_prefix_0, flags_0, sc_0, &v_10, 0), _fx_catch_3);
            FX_COPY_PTR(v_10.t1, &v_11);
            _fx_free_LN14K_form__kexp_t(&__fold_result___0);
            FX_COPY_PTR(v_11, &__fold_result___0);

         _fx_catch_3: ;
            if (v_11) {
               _fx_free_LN14K_form__kexp_t(&v_11);
            }
            _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_10);
            _fx_free_Nt6option1N14K_form__kexp_t(&v_9);
            _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_8);
            _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_7);
            _fx_free_N14K_form__atom_t(&v_6);
            if (ei_0) {
               _fx_free_N14K_form__kexp_t(&ei_0);
            }
            if (code_3) {
               _fx_free_LN14K_form__kexp_t(&code_3);
            }
            FX_CHECK_EXN(_fx_catch_4);
         }
         int s_0 = !lst_0 + !lst_1;
         FX_CHECK_EQ_SIZE(s_0 == 0 || s_0 == 2, _fx_catch_4);
         FX_COPY_PTR(__fold_result___0, &code_2);

      _fx_catch_4: ;
         if (pl_0) {
            _fx_free_LN10Ast__pat_t(&pl_0);
         }
         if (__fold_result___0) {
            _fx_free_LN14K_form__kexp_t(&__fold_result___0);
         }
         if (tl_0) {
            _fx_free_LN14K_form__ktyp_t(&tl_0);
         }
      }
      else if (tag_2 == 3) {
         FX_COPY_PTR(code_1, &code_2);
      }
      else if (tag_2 == 5) {
         _fx_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t v_12 = {0};
         _fx_N14K_form__ktyp_t vt_0 = 0;
         _fx_LT2N10Ast__pat_tN14K_form__ktyp_t typed_var_pl_0 = 0;
         _fx_N14K_form__atom_t v_13 = {0};
         _fx_N14K_form__klit_t v_14 = {0};
         _fx_N14K_form__atom_t v_15 = {0};
         _fx_LN14K_form__atom_t v_16 = 0;
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_17 = {0};
         _fx_N14K_form__kexp_t get_vcase_0 = 0;
         _fx_R10Ast__loc_t* loc_2 = &p_1->u.PatVariant.t2;
         FX_CALL(
            _fx_M11K_normalizeFM17match_variant_patT2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t2N10Ast__pat_tN14K_form__ktyp_t(
               p_1, ptyp_0, &v_12, 0), _fx_catch_8);
         _fx_T3R9Ast__id_tiN14K_form__ktyp_t* v_18 = &v_12.t0;
         int_ case_i_0 = v_18->t1;
         FX_COPY_PTR(v_18->t2, &vt_0);
         FX_COPY_PTR(v_12.t1, &typed_var_pl_0);
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_0, &v_13);
         int64_t res_2;
         FX_CALL(_fx_M11K_normalizeFM5int64l1i(case_i_0, &res_2, 0), _fx_catch_8);
         _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(res_2, &v_14);
         _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_14, &v_15);
         FX_CALL(_fx_cons_LN14K_form__atom_t(&v_15, 0, true, &v_16), _fx_catch_8);
         FX_CALL(_fx_cons_LN14K_form__atom_t(&v_13, v_16, false, &v_16), _fx_catch_8);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(vt_0, loc_2, &v_17);
         FX_CALL(
            _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
               &_fx_g30K_normalize__IntrinVariantCase, v_16, &v_17, &get_vcase_0), _fx_catch_8);
         if (typed_var_pl_0 != 0) {
            if (typed_var_pl_0->tl == 0) {
               _fx_Nt6option1N14K_form__kexp_t v_19 = {0};
               _fx_T2R9Ast__id_tLN14K_form__kexp_t v_20 = {0};
               _fx_T2N10Ast__pat_tN14K_form__ktyp_t* v_21 = &typed_var_pl_0->hd;
               _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(get_vcase_0, &v_19);
               FX_CALL(
                  _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
                     v_21->t0, v_21->t1, &v_19, code_1, temp_prefix_0, flags_0, sc_0, &v_20, 0), _fx_catch_5);
               FX_COPY_PTR(v_20.t1, &code_2);

            _fx_catch_5: ;
               _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_20);
               _fx_free_Nt6option1N14K_form__kexp_t(&v_19);
               goto _fx_endmatch_3;
            }
         }
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_22 = {0};
         _fx_N14K_form__atom_t ve_0 = {0};
         _fx_LN14K_form__kexp_t code_4 = 0;
         _fx_LN14K_form__kexp_t __fold_result___1 = 0;
         fx_str_t slit_2 = FX_MAKE_STR("vcase");
         FX_CALL(
            _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(km_idx_0,
               &slit_2, get_vcase_0, true, code_1, &v_22, 0), _fx_catch_7);
         _fx_copy_N14K_form__atom_t(&v_22.t0, &ve_0);
         FX_COPY_PTR(v_22.t1, &code_4);
         _fx_R9Ast__id_t ve_id_0;
         fx_str_t slit_3 = FX_MAKE_STR("variant case extraction should produce id, not literal");
         FX_CALL(_fx_M6K_formFM7atom2idR9Ast__id_t3N14K_form__atom_tR10Ast__loc_tS(&ve_0, loc_2, &slit_3, &ve_id_0, 0),
            _fx_catch_7);
         FX_COPY_PTR(code_4, &__fold_result___1);
         int_ idx_1 = 0;
         _fx_LT2N10Ast__pat_tN14K_form__ktyp_t lst_2 = typed_var_pl_0;
         for (; lst_2; lst_2 = lst_2->tl, idx_1 += 1) {
            _fx_N10Ast__pat_t pi_1 = 0;
            _fx_N14K_form__ktyp_t ti_1 = 0;
            _fx_LN14K_form__kexp_t code_5 = 0;
            _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_23 = {0};
            _fx_N14K_form__kexp_t ei_1 = 0;
            _fx_Nt6option1N14K_form__kexp_t v_24 = {0};
            _fx_T2R9Ast__id_tLN14K_form__kexp_t v_25 = {0};
            _fx_LN14K_form__kexp_t v_26 = 0;
            _fx_T2N10Ast__pat_tN14K_form__ktyp_t* __pat___0 = &lst_2->hd;
            FX_COPY_PTR(__pat___0->t0, &pi_1);
            FX_COPY_PTR(__pat___0->t1, &ti_1);
            FX_COPY_PTR(__fold_result___1, &code_5);
            _fx_R10Ast__loc_t loci_1;
            FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(pi_1, &loci_1, 0), _fx_catch_6);
            _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ti_1, &loci_1, &v_23);
            FX_CALL(
               _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&ve_id_0, idx_1, &v_23,
                  &ei_1), _fx_catch_6);
            _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(ei_1, &v_24);
            FX_CALL(
               _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
                  pi_1, ti_1, &v_24, code_5, temp_prefix_0, flags_0, sc_0, &v_25, 0), _fx_catch_6);
            FX_COPY_PTR(v_25.t1, &v_26);
            _fx_free_LN14K_form__kexp_t(&__fold_result___1);
            FX_COPY_PTR(v_26, &__fold_result___1);

         _fx_catch_6: ;
            if (v_26) {
               _fx_free_LN14K_form__kexp_t(&v_26);
            }
            _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_25);
            _fx_free_Nt6option1N14K_form__kexp_t(&v_24);
            if (ei_1) {
               _fx_free_N14K_form__kexp_t(&ei_1);
            }
            _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_23);
            if (code_5) {
               _fx_free_LN14K_form__kexp_t(&code_5);
            }
            if (ti_1) {
               _fx_free_N14K_form__ktyp_t(&ti_1);
            }
            if (pi_1) {
               _fx_free_N10Ast__pat_t(&pi_1);
            }
            FX_CHECK_EXN(_fx_catch_7);
         }
         FX_COPY_PTR(__fold_result___1, &code_2);

      _fx_catch_7: ;
         if (__fold_result___1) {
            _fx_free_LN14K_form__kexp_t(&__fold_result___1);
         }
         if (code_4) {
            _fx_free_LN14K_form__kexp_t(&code_4);
         }
         _fx_free_N14K_form__atom_t(&ve_0);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_22);

      _fx_endmatch_3: ;
         FX_CHECK_EXN(_fx_catch_8);

      _fx_catch_8: ;
         if (get_vcase_0) {
            _fx_free_N14K_form__kexp_t(&get_vcase_0);
         }
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_17);
         if (v_16) {
            _fx_free_LN14K_form__atom_t(&v_16);
         }
         _fx_free_N14K_form__atom_t(&v_15);
         _fx_free_N14K_form__klit_t(&v_14);
         _fx_free_N14K_form__atom_t(&v_13);
         if (typed_var_pl_0) {
            _fx_free_LT2N10Ast__pat_tN14K_form__ktyp_t(&typed_var_pl_0);
         }
         if (vt_0) {
            _fx_free_N14K_form__ktyp_t(&vt_0);
         }
         _fx_free_T2T3R9Ast__id_tiN14K_form__ktyp_tLT2N10Ast__pat_tN14K_form__ktyp_t(&v_12);
      }
      else if (tag_2 == 6) {
         _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti v_27 = {0};
         _fx_N14K_form__ktyp_t rectyp_0 = 0;
         _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti typed_rec_pl_0 = 0;
         _fx_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t v_28 = {0};
         _fx_N14K_form__kexp_t v_29 = 0;
         _fx_N14K_form__atom_t v_30 = {0};
         _fx_N14K_form__klit_t v_31 = {0};
         _fx_N14K_form__atom_t v_32 = {0};
         _fx_LN14K_form__atom_t v_33 = 0;
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_34 = {0};
         _fx_N14K_form__kexp_t get_vcase_1 = 0;
         _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_35 = {0};
         _fx_N14K_form__atom_t r_0 = {0};
         _fx_LN14K_form__kexp_t code2_0 = 0;
         _fx_N14K_form__kexp_t get_vcase_2 = 0;
         _fx_LN14K_form__kexp_t code2_1 = 0;
         FX_CALL(
            _fx_M11K_normalizeFM16match_record_patT2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti2N10Ast__pat_tN14K_form__ktyp_t(
               p_1, ptyp_0, &v_27, 0), _fx_catch_12);
         _fx_T5R9Ast__id_tiN14K_form__ktyp_tBB* v_36 = &v_27.t0;
         _fx_R9Ast__id_t ctor_0 = v_36->t0;
         int_ case_i_1 = v_36->t1;
         FX_COPY_PTR(v_36->t2, &rectyp_0);
         bool multiple_relems_0 = v_36->t4;
         FX_COPY_PTR(v_27.t1, &typed_rec_pl_0);
         bool res_3;
         FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&ctor_0, &_fx_g9Ast__noid, &res_3, 0), _fx_catch_12);
         if (res_3) {
            FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&loc_0, &v_29), _fx_catch_12);
            _fx_make_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t(&n_0, v_29, code_1, &v_28);
         }
         else {
            _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_0, &v_30);
            int64_t res_4;
            FX_CALL(_fx_M11K_normalizeFM5int64l1i(case_i_1, &res_4, 0), _fx_catch_12);
            _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(res_4, &v_31);
            _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_31, &v_32);
            FX_CALL(_fx_cons_LN14K_form__atom_t(&v_32, 0, true, &v_33), _fx_catch_12);
            FX_CALL(_fx_cons_LN14K_form__atom_t(&v_30, v_33, false, &v_33), _fx_catch_12);
            _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(rectyp_0, &loc_0, &v_34);
            FX_CALL(
               _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
                  &_fx_g30K_normalize__IntrinVariantCase, v_33, &v_34, &get_vcase_1), _fx_catch_12);
            fx_str_t slit_4 = FX_MAKE_STR("vcase");
            FX_CALL(
               _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(km_idx_0,
                  &slit_4, get_vcase_1, true, code_1, &v_35, 0), _fx_catch_12);
            _fx_copy_N14K_form__atom_t(&v_35.t0, &r_0);
            FX_COPY_PTR(v_35.t1, &code2_0);
            _fx_R9Ast__id_t v_37;
            fx_str_t slit_5 = FX_MAKE_STR("variant case extraction should produce id, not literal");
            FX_CALL(_fx_M6K_formFM7atom2idR9Ast__id_t3N14K_form__atom_tR10Ast__loc_tS(&r_0, &loc_0, &slit_5, &v_37, 0),
               _fx_catch_12);
            _fx_make_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t(&v_37, get_vcase_1, code2_0, &v_28);
         }
         _fx_R9Ast__id_t r_id_0 = v_28.t0;
         FX_COPY_PTR(v_28.t1, &get_vcase_2);
         FX_COPY_PTR(v_28.t2, &code2_1);
         bool res_5;
         FX_CALL(_fx_M11K_normalizeFM6__ne__B2R9Ast__id_tR9Ast__id_t(&ctor_0, &_fx_g9Ast__noid, &res_5, 0), _fx_catch_12);
         if (multiple_relems_0 == false) {
            if (res_5 == true) {
               if (typed_rec_pl_0 != 0) {
                  if (typed_rec_pl_0->tl == 0) {
                     _fx_Nt6option1N14K_form__kexp_t v_38 = {0};
                     _fx_T2R9Ast__id_tLN14K_form__kexp_t v_39 = {0};
                     _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* v_40 = &typed_rec_pl_0->hd;
                     _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(get_vcase_2, &v_38);
                     FX_CALL(
                        _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
                           v_40->t1, v_40->t2, &v_38, code_1, temp_prefix_0, flags_0, sc_0, &v_39, 0), _fx_catch_9);
                     FX_COPY_PTR(v_39.t1, &code_2);

                  _fx_catch_9: ;
                     _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_39);
                     _fx_free_Nt6option1N14K_form__kexp_t(&v_38);
                     goto _fx_endmatch_4;
                  }
               }
            }
         }
         _fx_LN14K_form__kexp_t __fold_result___2 = 0;
         FX_COPY_PTR(code2_1, &__fold_result___2);
         _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti lst_3 = typed_rec_pl_0;
         for (; lst_3; lst_3 = lst_3->tl) {
            _fx_N10Ast__pat_t pi_2 = 0;
            _fx_N14K_form__ktyp_t ti_2 = 0;
            _fx_LN14K_form__kexp_t code_6 = 0;
            _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_41 = {0};
            _fx_N14K_form__kexp_t ei_2 = 0;
            _fx_Nt6option1N14K_form__kexp_t v_42 = {0};
            _fx_T2R9Ast__id_tLN14K_form__kexp_t v_43 = {0};
            _fx_LN14K_form__kexp_t v_44 = 0;
            _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* __pat___1 = &lst_3->hd;
            FX_COPY_PTR(__pat___1->t1, &pi_2);
            FX_COPY_PTR(__pat___1->t2, &ti_2);
            FX_COPY_PTR(__fold_result___2, &code_6);
            _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ti_2, &loc_0, &v_41);
            FX_CALL(
               _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&r_id_0, __pat___1->t3,
                  &v_41, &ei_2), _fx_catch_10);
            _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(ei_2, &v_42);
            FX_CALL(
               _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
                  pi_2, ti_2, &v_42, code_6, temp_prefix_0, flags_0, sc_0, &v_43, 0), _fx_catch_10);
            FX_COPY_PTR(v_43.t1, &v_44);
            _fx_free_LN14K_form__kexp_t(&__fold_result___2);
            FX_COPY_PTR(v_44, &__fold_result___2);

         _fx_catch_10: ;
            if (v_44) {
               _fx_free_LN14K_form__kexp_t(&v_44);
            }
            _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_43);
            _fx_free_Nt6option1N14K_form__kexp_t(&v_42);
            if (ei_2) {
               _fx_free_N14K_form__kexp_t(&ei_2);
            }
            _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_41);
            if (code_6) {
               _fx_free_LN14K_form__kexp_t(&code_6);
            }
            if (ti_2) {
               _fx_free_N14K_form__ktyp_t(&ti_2);
            }
            if (pi_2) {
               _fx_free_N10Ast__pat_t(&pi_2);
            }
            FX_CHECK_EXN(_fx_catch_11);
         }
         FX_COPY_PTR(__fold_result___2, &code_2);

      _fx_catch_11: ;
         if (__fold_result___2) {
            _fx_free_LN14K_form__kexp_t(&__fold_result___2);
         }

      _fx_endmatch_4: ;
         FX_CHECK_EXN(_fx_catch_12);

      _fx_catch_12: ;
         if (code2_1) {
            _fx_free_LN14K_form__kexp_t(&code2_1);
         }
         if (get_vcase_2) {
            _fx_free_N14K_form__kexp_t(&get_vcase_2);
         }
         if (code2_0) {
            _fx_free_LN14K_form__kexp_t(&code2_0);
         }
         _fx_free_N14K_form__atom_t(&r_0);
         _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_35);
         if (get_vcase_1) {
            _fx_free_N14K_form__kexp_t(&get_vcase_1);
         }
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_34);
         if (v_33) {
            _fx_free_LN14K_form__atom_t(&v_33);
         }
         _fx_free_N14K_form__atom_t(&v_32);
         _fx_free_N14K_form__klit_t(&v_31);
         _fx_free_N14K_form__atom_t(&v_30);
         if (v_29) {
            _fx_free_N14K_form__kexp_t(&v_29);
         }
         _fx_free_T3R9Ast__id_tN14K_form__kexp_tLN14K_form__kexp_t(&v_28);
         if (typed_rec_pl_0) {
            _fx_free_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&typed_rec_pl_0);
         }
         if (rectyp_0) {
            _fx_free_N14K_form__ktyp_t(&rectyp_0);
         }
         _fx_free_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&v_27);
      }
      else if (tag_2 == 8) {
         _fx_N14K_form__atom_t v_45 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_46 = {0};
         _fx_N14K_form__kexp_t e_1 = 0;
         _fx_Nt6option1N14K_form__kexp_t v_47 = {0};
         _fx_T2R9Ast__id_tLN14K_form__kexp_t v_48 = {0};
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_0, &v_45);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ptyp_0, &loc_0, &v_46);
         FX_CALL(_fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_45, &v_46, &e_1),
            _fx_catch_13);
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(e_1, &v_47);
         FX_CALL(
            _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
               p_1, ptyp_0, &v_47, code_1, temp_prefix_0, flags_0, sc_0, &v_48, 0), _fx_catch_13);
         FX_COPY_PTR(v_48.t1, &code_2);

      _fx_catch_13: ;
         _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_48);
         _fx_free_Nt6option1N14K_form__kexp_t(&v_47);
         if (e_1) {
            _fx_free_N14K_form__kexp_t(&e_1);
         }
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_46);
         _fx_free_N14K_form__atom_t(&v_45);
      }
      else if (tag_2 == 12) {
         _fx_N14K_form__ktyp_t t_1 = 0;
         _fx_N14K_form__atom_t v_49 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_50 = {0};
         _fx_N14K_form__kexp_t e_2 = 0;
         _fx_Nt6option1N14K_form__kexp_t v_51 = {0};
         _fx_T2R9Ast__id_tLN14K_form__kexp_t v_52 = {0};
         _fx_T2N10Ast__pat_tR10Ast__loc_t* vcase_1 = &p_1->u.PatRef;
         _fx_R10Ast__loc_t* loc_3 = &vcase_1->t1;
         if (FX_REC_VARIANT_TAG(ptyp_0) == 20) {
            FX_COPY_PTR(ptyp_0->u.KTypRef, &t_1);
         }
         else {
            fx_exn_t v_53 = {0};
            fx_str_t slit_6 = FX_MAKE_STR("the argument of ref() pattern must be a reference");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_3, &slit_6, &v_53, 0), _fx_catch_14);
            FX_THROW(&v_53, false, _fx_catch_14);

         _fx_catch_14: ;
            fx_free_exn(&v_53);
         }
         FX_CHECK_EXN(_fx_catch_15);
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_0, &v_49);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(t_1, loc_3, &v_50);
         FX_CALL(
            _fx_M6K_formFM9KExpUnaryN14K_form__kexp_t3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
               &_fx_g20K_normalize__OpDeref, &v_49, &v_50, &e_2), _fx_catch_15);
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(e_2, &v_51);
         FX_CALL(
            _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
               vcase_1->t0, t_1, &v_51, code_1, temp_prefix_0, &n_flags_2, sc_0, &v_52, 0), _fx_catch_15);
         FX_COPY_PTR(v_52.t1, &code_2);

      _fx_catch_15: ;
         _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_52);
         _fx_free_Nt6option1N14K_form__kexp_t(&v_51);
         if (e_2) {
            _fx_free_N14K_form__kexp_t(&e_2);
         }
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_50);
         _fx_free_N14K_form__atom_t(&v_49);
         if (t_1) {
            _fx_free_N14K_form__ktyp_t(&t_1);
         }
      }
      else {
         fx_exn_t v_54 = {0};
         fx_str_t slit_7 = FX_MAKE_STR("this type of pattern cannot be used here");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_7, &v_54, 0), _fx_catch_16);
         FX_THROW(&v_54, false, _fx_catch_16);

      _fx_catch_16: ;
         fx_free_exn(&v_54);
      }
      FX_CHECK_EXN(_fx_cleanup);
      _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&n_0, code_2, fx_result);
   }

_fx_cleanup: ;
   _fx_free_T2LN14K_form__atom_tB(&v_0);
   if (tup_elems_0) {
      _fx_free_LN14K_form__atom_t(&tup_elems_0);
   }
   _fx_free_R16Ast__val_flags_t(&n_flags_0);
   _fx_free_T4N10Ast__pat_tR9Ast__id_tBB(&v_1);
   if (p_1) {
      _fx_free_N10Ast__pat_t(&p_1);
   }
   _fx_free_R16Ast__val_flags_t(&n_flags_1);
   _fx_free_R16Ast__val_flags_t(&n_flags_2);
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   if (code_2) {
      _fx_free_LN14K_form__kexp_t(&code_2);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM12dispatch_patTa3LRM10pat_info_t2RM10pat_info_tTa3LRM10pat_info_t(
   struct _fx_R23K_normalize__pat_info_t* pinfo_0,
   struct _fx_Ta3LR23K_normalize__pat_info_t* arg1_0,
   struct _fx_Ta3LR23K_normalize__pat_info_t* fx_result,
   void* fx_fv)
{
   _fx_LR23K_normalize__pat_info_t pl_c_0 = 0;
   _fx_LR23K_normalize__pat_info_t pl_cu_0 = 0;
   _fx_LR23K_normalize__pat_info_t pl_u_0 = 0;
   _fx_N14K_form__ktyp_t ptyp_0 = 0;
   _fx_N10Ast__pat_t p_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(arg1_0->t0, &pl_c_0);
   FX_COPY_PTR(arg1_0->t1, &pl_cu_0);
   FX_COPY_PTR(arg1_0->t2, &pl_u_0);
   FX_COPY_PTR(pinfo_0->pinfo_typ, &ptyp_0);
   FX_COPY_PTR(pinfo_0->pinfo_p, &p_0);
   bool need_checks_0;
   FX_CALL(_fx_M11K_normalizeFM15pat_need_checksB2N10Ast__pat_tN14K_form__ktyp_t(p_0, ptyp_0, &need_checks_0, 0), _fx_cleanup);
   bool have_vars_0;
   FX_CALL(_fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(p_0, &have_vars_0, 0), _fx_cleanup);
   if (have_vars_0 == false) {
      if (need_checks_0 == true) {
         if (FX_REC_VARIANT_TAG(p_0) == 2) {
            _fx_LR23K_normalize__pat_info_t v_0 = 0;
            FX_CALL(_fx_cons_LR23K_normalize__pat_info_t(pinfo_0, pl_c_0, true, &v_0), _fx_catch_0);
            _fx_make_Ta3LR23K_normalize__pat_info_t(v_0, pl_cu_0, pl_u_0, fx_result);

         _fx_catch_0: ;
            if (v_0) {
               _fx_free_LR23K_normalize__pat_info_t(&v_0);
            }
         }
         else {
            _fx_LR23K_normalize__pat_info_t v_1 = 0;
            _fx_LR23K_normalize__pat_info_t v_2 = 0;
            FX_CALL(_fx_cons_LR23K_normalize__pat_info_t(pinfo_0, 0, true, &v_1), _fx_catch_3);
            if (pl_c_0 == 0) {
               FX_COPY_PTR(v_1, &v_2);
            }
            else if (v_1 == 0) {
               FX_COPY_PTR(pl_c_0, &v_2);
            }
            else {
               _fx_LR23K_normalize__pat_info_t v_3 = 0;
               _fx_LR23K_normalize__pat_info_t lstend_0 = 0;
               _fx_LR23K_normalize__pat_info_t lst_0 = pl_c_0;
               for (; lst_0; lst_0 = lst_0->tl) {
                  _fx_R23K_normalize__pat_info_t* x_0 = &lst_0->hd;
                  _fx_LR23K_normalize__pat_info_t node_0 = 0;
                  FX_CALL(_fx_cons_LR23K_normalize__pat_info_t(x_0, 0, false, &node_0), _fx_catch_1);
                  FX_LIST_APPEND(v_3, lstend_0, node_0);

               _fx_catch_1: ;
                  FX_CHECK_EXN(_fx_catch_2);
               }
               _fx_M11K_normalizeFM5link2LRM10pat_info_t2LRM10pat_info_tLRM10pat_info_t(v_3, v_1, &v_2, 0);

            _fx_catch_2: ;
               if (v_3) {
                  _fx_free_LR23K_normalize__pat_info_t(&v_3);
               }
            }
            FX_CHECK_EXN(_fx_catch_3);
            _fx_make_Ta3LR23K_normalize__pat_info_t(v_2, pl_cu_0, pl_u_0, fx_result);

         _fx_catch_3: ;
            if (v_2) {
               _fx_free_LR23K_normalize__pat_info_t(&v_2);
            }
            if (v_1) {
               _fx_free_LR23K_normalize__pat_info_t(&v_1);
            }
         }
         FX_CHECK_EXN(_fx_catch_4);

      _fx_catch_4: ;
         goto _fx_endmatch_0;
      }
   }
   if (have_vars_0 == true) {
      if (need_checks_0 == true) {
         _fx_LR23K_normalize__pat_info_t v_4 = 0;
         FX_CALL(_fx_cons_LR23K_normalize__pat_info_t(pinfo_0, pl_cu_0, true, &v_4), _fx_catch_5);
         _fx_make_Ta3LR23K_normalize__pat_info_t(pl_c_0, v_4, pl_u_0, fx_result);

      _fx_catch_5: ;
         if (v_4) {
            _fx_free_LR23K_normalize__pat_info_t(&v_4);
         }
         goto _fx_endmatch_0;
      }
   }
   if (have_vars_0 == true) {
      if (need_checks_0 == false) {
         _fx_LR23K_normalize__pat_info_t v_5 = 0;
         FX_CALL(_fx_cons_LR23K_normalize__pat_info_t(pinfo_0, pl_u_0, true, &v_5), _fx_catch_6);
         _fx_make_Ta3LR23K_normalize__pat_info_t(pl_c_0, pl_cu_0, v_5, fx_result);

      _fx_catch_6: ;
         if (v_5) {
            _fx_free_LR23K_normalize__pat_info_t(&v_5);
         }
         goto _fx_endmatch_0;
      }
   }
   _fx_make_Ta3LR23K_normalize__pat_info_t(pl_c_0, pl_cu_0, pl_u_0, fx_result);

_fx_endmatch_0: ;

_fx_cleanup: ;
   if (pl_c_0) {
      _fx_free_LR23K_normalize__pat_info_t(&pl_c_0);
   }
   if (pl_cu_0) {
      _fx_free_LR23K_normalize__pat_info_t(&pl_cu_0);
   }
   if (pl_u_0) {
      _fx_free_LR23K_normalize__pat_info_t(&pl_u_0);
   }
   if (ptyp_0) {
      _fx_free_N14K_form__ktyp_t(&ptyp_0);
   }
   if (p_0) {
      _fx_free_N10Ast__pat_t(&p_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM19get_extract_tag_expN14K_form__kexp_t3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_N14K_form__ktyp_t_data_t* atyp_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N14K_form__ktyp_t v_0 = 0;
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM10deref_ktypN14K_form__ktyp_t2N14K_form__ktyp_tR10Ast__loc_t(atyp_0, loc_0, &v_0, 0), _fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(v_0);
   if (tag_0 == 21) {
      _fx_LN14K_form__atom_t v_1 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_2 = {0};
      FX_CALL(_fx_cons_LN14K_form__atom_t(a_0, 0, true, &v_1), _fx_catch_0);
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypCInt, loc_0, &v_2);
      FX_CALL(
         _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &_fx_g29K_normalize__IntrinVariantTag, v_1, &v_2, fx_result), _fx_catch_0);

   _fx_catch_0: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_2);
      if (v_1) {
         _fx_free_LN14K_form__atom_t(&v_1);
      }
   }
   else if (tag_0 == 15) {
      _fx_N14K_form__klit_t v_3 = {0};
      _fx_N14K_form__atom_t v_4 = {0};
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_5 = {0};
      _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(0LL, &v_3);
      _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_3, &v_4);
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypCInt, loc_0, &v_5);
      FX_CALL(_fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_4, &v_5, fx_result),
         _fx_catch_1);

   _fx_catch_1: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_5);
      _fx_free_N14K_form__atom_t(&v_4);
      _fx_free_N14K_form__klit_t(&v_3);
   }
   else if (tag_0 == 16) {
      _fx_N15K_form__kinfo_t v_6 = {0};
      _fx_R9Ast__id_t* tn_0 = &v_0->u.KTypName;
      FX_CALL(_fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(tn_0, loc_0, &v_6, 0), _fx_catch_6);
      if (v_6.tag == 5) {
         _fx_R21K_form__kdefvariant_t v_7 = {0};
         _fx_copy_R21K_form__kdefvariant_t(&v_6.u.KVariant->data, &v_7);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_0 = v_7.kvar_cases;
         if (kvar_cases_0 != 0) {
            if (kvar_cases_0->tl == 0) {
               _fx_N14K_form__klit_t v_8 = {0};
               _fx_N14K_form__atom_t v_9 = {0};
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_10 = {0};
               _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(1LL, &v_8);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_8, &v_9);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypCInt, loc_0, &v_10);
               FX_CALL(
                  _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_9, &v_10,
                     fx_result), _fx_catch_2);

            _fx_catch_2: ;
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_10);
               _fx_free_N14K_form__atom_t(&v_9);
               _fx_free_N14K_form__klit_t(&v_8);
               goto _fx_endmatch_0;
            }
         }
         _fx_LN14K_form__atom_t v_11 = 0;
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_12 = {0};
         FX_CALL(_fx_cons_LN14K_form__atom_t(a_0, 0, true, &v_11), _fx_catch_3);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypCInt, loc_0, &v_12);
         FX_CALL(
            _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
               &_fx_g29K_normalize__IntrinVariantTag, v_11, &v_12, fx_result), _fx_catch_3);

      _fx_catch_3: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_12);
         if (v_11) {
            _fx_free_LN14K_form__atom_t(&v_11);
         }

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_4);

      _fx_catch_4: ;
         _fx_free_R21K_form__kdefvariant_t(&v_7);
      }
      else {
         fx_str_t v_13 = {0};
         fx_str_t v_14 = {0};
         fx_exn_t v_15 = {0};
         FX_CALL(_fx_M3AstFM6stringS1RM4id_t(tn_0, &v_13, 0), _fx_catch_5);
         fx_str_t slit_0 = FX_MAKE_STR("k-normalize: enxpected type \'");
         fx_str_t slit_1 = FX_MAKE_STR("\'; record, variant of exception is expected here");
         {
            const fx_str_t strs_0[] = { slit_0, v_13, slit_1 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_14), _fx_catch_5);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_14, &v_15, 0), _fx_catch_5);
         FX_THROW(&v_15, false, _fx_catch_5);

      _fx_catch_5: ;
         fx_free_exn(&v_15);
         FX_FREE_STR(&v_14);
         FX_FREE_STR(&v_13);
      }
      FX_CHECK_EXN(_fx_catch_6);

   _fx_catch_6: ;
      _fx_free_N15K_form__kinfo_t(&v_6);
   }
   else {
      fx_str_t v_16 = {0};
      fx_str_t v_17 = {0};
      fx_exn_t v_18 = {0};
      FX_CALL(_fx_M6K_formFM6stringS1N14K_form__ktyp_t(v_0, &v_16, 0), _fx_catch_7);
      fx_str_t slit_2 = FX_MAKE_STR("k-normalize: enxpected type \'");
      fx_str_t slit_3 = FX_MAKE_STR("\'; record, variant of exception is expected here");
      {
         const fx_str_t strs_1[] = { slit_2, v_16, slit_3 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_17), _fx_catch_7);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_17, &v_18, 0), _fx_catch_7);
      FX_THROW(&v_18, false, _fx_catch_7);

   _fx_catch_7: ;
      fx_free_exn(&v_18);
      FX_FREE_STR(&v_17);
      FX_FREE_STR(&v_16);
   }

_fx_cleanup: ;
   if (v_0) {
      _fx_free_N14K_form__ktyp_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM16process_pat_listTa3LRM10pat_info_t4R9Ast__id_tLT3N10Ast__pat_tN14K_form__ktyp_tiTa3LRM10pat_info_tNt6option1N14K_form__kexp_t(
   struct _fx_R9Ast__id_t* tup_id_0,
   struct _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti_data_t* pti_l_0,
   struct _fx_Ta3LR23K_normalize__pat_info_t* plists_0,
   struct _fx_Nt6option1N14K_form__kexp_t* alt_ei_opt_0,
   struct _fx_Ta3LR23K_normalize__pat_info_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (pti_l_0 != 0) {
      if (pti_l_0->tl == 0) {
         if (FX_REC_VARIANT_TAG(pti_l_0->hd.t0) == 1) {
            _fx_copy_Ta3LR23K_normalize__pat_info_t(plists_0, fx_result); goto _fx_endmatch_0;
         }
      }
   }
   _fx_LR23K_normalize__pat_info_t __fold_result___0 = 0;
   _fx_LR23K_normalize__pat_info_t plists_delta_0 = 0;
   _fx_Ta3LR23K_normalize__pat_info_t __fold_result___1 = {0};
   int_ idx_0 = 0;
   _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti lst_0 = pti_l_0;
   for (; lst_0; lst_0 = lst_0->tl, idx_0 += 1) {
      _fx_N10Ast__pat_t pi_0 = 0;
      _fx_N14K_form__ktyp_t ti_0 = 0;
      _fx_LR23K_normalize__pat_info_t plists_delta_1 = 0;
      _fx_N14K_form__kexp_t ei_0 = 0;
      _fx_R23K_normalize__pat_info_t pinfo_i_0 = {0};
      _fx_T3N10Ast__pat_tN14K_form__ktyp_ti* __pat___0 = &lst_0->hd;
      FX_COPY_PTR(__pat___0->t0, &pi_0);
      FX_COPY_PTR(__pat___0->t1, &ti_0);
      FX_COPY_PTR(__fold_result___0, &plists_delta_1);
      _fx_R10Ast__loc_t loci_0;
      FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(pi_0, &loci_0, 0), _fx_catch_2);
      if (alt_ei_opt_0->tag == 2) {
         fx_exn_t v_0 = {0};
         if (idx_0 != 0) {
            fx_str_t slit_0 =
               FX_MAKE_STR("a code for singe-argument variant case handling is used with a case with multiple patterns");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loci_0, &slit_0, &v_0, 0), _fx_catch_0);
            FX_THROW(&v_0, false, _fx_catch_0);
         }
         FX_COPY_PTR(alt_ei_opt_0->u.Some, &ei_0);

      _fx_catch_0: ;
         fx_free_exn(&v_0);
      }
      else {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_1 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ti_0, &loci_0, &v_1);
         FX_CALL(
            _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(tup_id_0, __pat___0->t2, &v_1,
               &ei_0), _fx_catch_1);

      _fx_catch_1: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_1);
      }
      FX_CHECK_EXN(_fx_catch_2);
      _fx_make_R23K_normalize__pat_info_t(pi_0, ti_0, ei_0, &_fx_g9Ast__noid, &pinfo_i_0);
      FX_CALL(_fx_cons_LR23K_normalize__pat_info_t(&pinfo_i_0, plists_delta_1, false, &plists_delta_1), _fx_catch_2);
      _fx_free_LR23K_normalize__pat_info_t(&__fold_result___0);
      FX_COPY_PTR(plists_delta_1, &__fold_result___0);

   _fx_catch_2: ;
      _fx_free_R23K_normalize__pat_info_t(&pinfo_i_0);
      if (ei_0) {
         _fx_free_N14K_form__kexp_t(&ei_0);
      }
      if (plists_delta_1) {
         _fx_free_LR23K_normalize__pat_info_t(&plists_delta_1);
      }
      if (ti_0) {
         _fx_free_N14K_form__ktyp_t(&ti_0);
      }
      if (pi_0) {
         _fx_free_N10Ast__pat_t(&pi_0);
      }
      FX_CHECK_EXN(_fx_catch_4);
   }
   FX_COPY_PTR(__fold_result___0, &plists_delta_0);
   _fx_copy_Ta3LR23K_normalize__pat_info_t(plists_0, &__fold_result___1);
   _fx_LR23K_normalize__pat_info_t lst_1 = plists_delta_0;
   for (; lst_1; lst_1 = lst_1->tl) {
      _fx_Ta3LR23K_normalize__pat_info_t plists_1 = {0};
      _fx_Ta3LR23K_normalize__pat_info_t v_2 = {0};
      _fx_R23K_normalize__pat_info_t* pinfo_0 = &lst_1->hd;
      _fx_copy_Ta3LR23K_normalize__pat_info_t(&__fold_result___1, &plists_1);
      FX_CALL(
         _fx_M11K_normalizeFM12dispatch_patTa3LRM10pat_info_t2RM10pat_info_tTa3LRM10pat_info_t(pinfo_0, &plists_1, &v_2, 0),
         _fx_catch_3);
      _fx_free_Ta3LR23K_normalize__pat_info_t(&__fold_result___1);
      _fx_copy_Ta3LR23K_normalize__pat_info_t(&v_2, &__fold_result___1);

   _fx_catch_3: ;
      _fx_free_Ta3LR23K_normalize__pat_info_t(&v_2);
      _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_1);
      FX_CHECK_EXN(_fx_catch_4);
   }
   _fx_copy_Ta3LR23K_normalize__pat_info_t(&__fold_result___1, fx_result);

_fx_catch_4: ;
   _fx_free_Ta3LR23K_normalize__pat_info_t(&__fold_result___1);
   if (plists_delta_0) {
      _fx_free_LR23K_normalize__pat_info_t(&plists_delta_0);
   }
   if (__fold_result___0) {
      _fx_free_LR23K_normalize__pat_info_t(&__fold_result___0);
   }

_fx_endmatch_0: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM10__lambda__S1R9Ast__id_t(struct _fx_R9Ast__id_t* n_0, fx_str_t* fx_result, void* fx_fv)
{
   fx_str_t v_0 = {0};
   int fx_status = 0;
   FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_0, 0), _fx_cleanup);
   fx_str_t slit_0 = FX_MAKE_STR("\'");
   fx_str_t slit_1 = FX_MAKE_STR("\'");
   {
      const fx_str_t strs_0[] = { slit_0, v_0, slit_1 };
      FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, fx_result), _fx_cleanup);
   }

_fx_cleanup: ;
   FX_FREE_STR(&v_0);
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM22transform_pat_matchingT2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t6N14K_form__atom_tLT2N10Ast__pat_tN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_tB(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* cases_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool catch_mode_0,
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_rRt6Set__t1R9Ast__id_t match_var_cases_ref_0 = 0;
   _fx_N14K_form__ktyp_t atyp_0 = 0;
   _fx_T2R9Ast__id_tLN14K_form__kexp_t v_0 = {0};
   _fx_N14K_form__kexp_t extract_tag_exp_0 = 0;
   _fx_R16Ast__val_flags_t v_1 = {0};
   _fx_Nt6option1N14K_form__kexp_t v_2 = {0};
   _fx_LN14K_form__kexp_t code_1 = 0;
   _fx_LN14K_form__kexp_t code_2 = 0;
   _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t k_cases_0 = 0;
   _fx_FPS1R9Ast__id_t __lambda___0 = {0};
   _fx_LS v_3 = 0;
   fx_str_t idlist_0 = {0};
   fx_str_t msg_0 = {0};
   fx_str_t v_4 = {0};
   fx_str_t v_5 = {0};
   fx_str_t v_6 = {0};
   fx_str_t v_7 = {0};
   fx_exn_t v_8 = {0};
   _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t k_cases_1 = 0;
   _fx_N14K_form__kexp_t rethrow_exp_0 = 0;
   _fx_T2LN14K_form__kexp_tN14K_form__kexp_t v_9 = {0};
   _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t v_10 = 0;
   fx_exn_t v_11 = {0};
   _fx_N14K_form__kexp_t nomatch_err_0 = 0;
   _fx_T2LN14K_form__kexp_tN14K_form__kexp_t v_12 = {0};
   _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t v_13 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(_fx_make_rRt6Set__t1R9Ast__id_t(&_fx_g16Ast__empty_idset, &match_var_cases_ref_0), _fx_cleanup);
   _fx_Rt6Set__t1R9Ast__id_t* match_var_cases_0 = &match_var_cases_ref_0->data;
   int_ km_idx_0;
   FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &km_idx_0, 0), _fx_cleanup);
   FX_CALL(_fx_M6K_formFM13get_atom_ktypN14K_form__ktyp_t2N14K_form__atom_tR10Ast__loc_t(a_0, loc_0, &atyp_0, 0), _fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(atyp_0);
   bool is_variant_0;
   if (tag_0 == 21) {
      is_variant_0 = true;
   }
   else if (tag_0 == 16) {
      _fx_N15K_form__kinfo_t v_14 = {0};
      FX_CALL(_fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(&atyp_0->u.KTypName, loc_0, &v_14, 0),
         _fx_catch_2);
      if (v_14.tag == 5) {
         _fx_R21K_form__kdefvariant_t v_15 = {0};
         _fx_Rt6Set__t1R9Ast__id_t __fold_result___0 = {0};
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_0 = 0;
         _fx_copy_R21K_form__kdefvariant_t(&v_14.u.KVariant->data, &v_15);
         _fx_copy_Rt6Set__t1R9Ast__id_t(&_fx_g16Ast__empty_idset, &__fold_result___0);
         FX_COPY_PTR(v_15.kvar_cases, &kvar_cases_0);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_0 = kvar_cases_0;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_Rt6Set__t1R9Ast__id_t match_var_cases_1 = {0};
            _fx_Rt6Set__t1R9Ast__id_t v_16 = {0};
            _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___0 = &lst_0->hd;
            _fx_R9Ast__id_t n_0 = __pat___0->t0;
            _fx_copy_Rt6Set__t1R9Ast__id_t(&__fold_result___0, &match_var_cases_1);
            _fx_R9Ast__id_t v_17;
            FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(&n_0, &v_17, 0), _fx_catch_0);
            FX_CALL(
               _fx_M11K_normalizeFM3addRt6Set__t1R9Ast__id_t2Rt6Set__t1R9Ast__id_tR9Ast__id_t(&match_var_cases_1, &v_17, &v_16,
                  0), _fx_catch_0);
            _fx_free_Rt6Set__t1R9Ast__id_t(&__fold_result___0);
            _fx_copy_Rt6Set__t1R9Ast__id_t(&v_16, &__fold_result___0);

         _fx_catch_0: ;
            _fx_free_Rt6Set__t1R9Ast__id_t(&v_16);
            _fx_free_Rt6Set__t1R9Ast__id_t(&match_var_cases_1);
            FX_CHECK_EXN(_fx_catch_1);
         }
         _fx_free_Rt6Set__t1R9Ast__id_t(match_var_cases_0);
         _fx_copy_Rt6Set__t1R9Ast__id_t(&__fold_result___0, match_var_cases_0);
         is_variant_0 = true;

      _fx_catch_1: ;
         if (kvar_cases_0) {
            _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kvar_cases_0);
         }
         _fx_free_Rt6Set__t1R9Ast__id_t(&__fold_result___0);
         _fx_free_R21K_form__kdefvariant_t(&v_15);
      }
      else {
         is_variant_0 = false;
      }
      FX_CHECK_EXN(_fx_catch_2);

   _fx_catch_2: ;
      _fx_free_N15K_form__kinfo_t(&v_14);
   }
   else {
      is_variant_0 = false;
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (!is_variant_0) {
      _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&_fx_g9Ast__noid, code_0, &v_0);
   }
   else {
      _fx_R9Ast__id_t tag_n_0;
      fx_str_t slit_0 = FX_MAKE_STR("tag");
      FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, &slit_0, &tag_n_0, 0), _fx_cleanup);
      FX_CALL(
         _fx_M11K_normalizeFM19get_extract_tag_expN14K_form__kexp_t3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(a_0, atyp_0,
            loc_0, &extract_tag_exp_0, 0), _fx_cleanup);
      FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_1, 0), _fx_cleanup);
      _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(extract_tag_exp_0, &v_2);
      FX_CALL(
         _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
            &tag_n_0, _fx_g21K_normalize__KTypCInt, &v_1, &v_2, code_0, loc_0, &code_1, 0), _fx_cleanup);
      _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&tag_n_0, code_1, &v_0);
   }
   _fx_R9Ast__id_t var_tag0_0 = v_0.t0;
   FX_COPY_PTR(v_0.t1, &code_2);
   bool have_else_0 = false;
   _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t lstend_0 = 0;
   _fx_LT2N10Ast__pat_tN10Ast__exp_t lst_1 = cases_0;
   for (; lst_1; lst_1 = lst_1->tl) {
      _fx_N10Ast__pat_t p_0 = 0;
      _fx_N10Ast__exp_t e_0 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_18 = {0};
      _fx_N14K_form__kexp_t v_19 = 0;
      _fx_R23K_normalize__pat_info_t pinfo_0 = {0};
      fx_exn_t v_20 = {0};
      _fx_Ta3LR23K_normalize__pat_info_t v_21 = {0};
      _fx_Ta3LR23K_normalize__pat_info_t plists_0 = {0};
      _fx_LN12Ast__scope_t case_sc_0 = 0;
      _fx_Ta2LN14K_form__kexp_t v_22 = {0};
      _fx_Ta2LN14K_form__kexp_t v_23 = {0};
      _fx_LN14K_form__kexp_t checks_0 = 0;
      _fx_LN14K_form__kexp_t case_code_0 = 0;
      _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_24 = {0};
      _fx_N14K_form__kexp_t ke_0 = 0;
      _fx_LN14K_form__kexp_t case_code_1 = 0;
      _fx_LN14K_form__kexp_t v_25 = 0;
      _fx_N14K_form__kexp_t ke_1 = 0;
      _fx_LN14K_form__kexp_t v_26 = 0;
      _fx_T2LN14K_form__kexp_tN14K_form__kexp_t tup_0 = {0};
      _fx_T2N10Ast__pat_tN10Ast__exp_t* __pat___1 = &lst_1->hd;
      FX_COPY_PTR(__pat___1->t0, &p_0);
      FX_COPY_PTR(__pat___1->t1, &e_0);
      _fx_R10Ast__loc_t ploc_0;
      FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(p_0, &ploc_0, 0), _fx_catch_3);
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(atyp_0, loc_0, &v_18);
      FX_CALL(_fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(a_0, &v_18, &v_19),
         _fx_catch_3);
      _fx_make_R23K_normalize__pat_info_t(p_0, atyp_0, v_19, &var_tag0_0, &pinfo_0);
      if (have_else_0) {
         fx_str_t slit_1 = FX_MAKE_STR("unreacheable pattern matching case");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&ploc_0, &slit_1, &v_20, 0), _fx_catch_3);
         FX_THROW(&v_20, false, _fx_catch_3);
      }
      _fx_make_Ta3LR23K_normalize__pat_info_t(0, 0, 0, &v_21);
      FX_CALL(
         _fx_M11K_normalizeFM12dispatch_patTa3LRM10pat_info_t2RM10pat_info_tTa3LRM10pat_info_t(&pinfo_0, &v_21, &plists_0, 0),
         _fx_catch_3);
      _fx_N12Ast__scope_t v_27;
      FX_CALL(_fx_M3AstFM15new_block_scopeN12Ast__scope_t1i(km_idx_0, &v_27, 0), _fx_catch_3);
      FX_CALL(_fx_cons_LN12Ast__scope_t(&v_27, sc_0, true, &case_sc_0), _fx_catch_3);
      _fx_make_Ta2LN14K_form__kexp_t(0, 0, &v_22);
      FX_CALL(
         _fx_M11K_normalizeFM19process_next_subpatTa2LN14K_form__kexp_t6Ta3LRM10pat_info_tTa2LN14K_form__kexp_tLN12Ast__scope_tirRt6Set__t1R9Ast__id_tLN12Ast__scope_t(
            &plists_0, &v_22, case_sc_0, km_idx_0, match_var_cases_ref_0, sc_0, &v_23, 0), _fx_catch_3);
      FX_COPY_PTR(v_23.t0, &checks_0);
      FX_COPY_PTR(v_23.t1, &case_code_0);
      FX_CALL(
         _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
            e_0, case_code_0, false, case_sc_0, &v_24, 0), _fx_catch_3);
      FX_COPY_PTR(v_24.t0, &ke_0);
      FX_COPY_PTR(v_24.t1, &case_code_1);
      _fx_R10Ast__loc_t eloc_0;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_0, &eloc_0, 0), _fx_catch_3);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(ke_0, case_code_1, true, &v_25), _fx_catch_3);
      FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_25, &eloc_0, &ke_1, 0),
         _fx_catch_3);
      if (checks_0 == 0) {
         have_else_0 = true;
      }
      FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__kexp_t1LN14K_form__kexp_t(checks_0, &v_26, 0), _fx_catch_3);
      _fx_make_T2LN14K_form__kexp_tN14K_form__kexp_t(v_26, ke_1, &tup_0);
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t node_0 = 0;
      FX_CALL(_fx_cons_LT2LN14K_form__kexp_tN14K_form__kexp_t(&tup_0, 0, false, &node_0), _fx_catch_3);
      FX_LIST_APPEND(k_cases_0, lstend_0, node_0);

   _fx_catch_3: ;
      _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t(&tup_0);
      if (v_26) {
         _fx_free_LN14K_form__kexp_t(&v_26);
      }
      if (ke_1) {
         _fx_free_N14K_form__kexp_t(&ke_1);
      }
      if (v_25) {
         _fx_free_LN14K_form__kexp_t(&v_25);
      }
      if (case_code_1) {
         _fx_free_LN14K_form__kexp_t(&case_code_1);
      }
      if (ke_0) {
         _fx_free_N14K_form__kexp_t(&ke_0);
      }
      _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_24);
      if (case_code_0) {
         _fx_free_LN14K_form__kexp_t(&case_code_0);
      }
      if (checks_0) {
         _fx_free_LN14K_form__kexp_t(&checks_0);
      }
      _fx_free_Ta2LN14K_form__kexp_t(&v_23);
      _fx_free_Ta2LN14K_form__kexp_t(&v_22);
      FX_FREE_LIST_SIMPLE(&case_sc_0);
      _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_0);
      _fx_free_Ta3LR23K_normalize__pat_info_t(&v_21);
      fx_free_exn(&v_20);
      _fx_free_R23K_normalize__pat_info_t(&pinfo_0);
      if (v_19) {
         _fx_free_N14K_form__kexp_t(&v_19);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_18);
      if (e_0) {
         _fx_free_N10Ast__exp_t(&e_0);
      }
      if (p_0) {
         _fx_free_N10Ast__pat_t(&p_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   bool t_0;
   if (is_variant_0) {
      t_0 = !have_else_0;
   }
   else {
      t_0 = false;
   }
   bool t_1;
   if (t_0) {
      bool res_0;
      FX_CALL(_fx_M11K_normalizeFM5emptyB1Rt6Set__t1R9Ast__id_t(match_var_cases_0, &res_0, 0), _fx_cleanup);
      t_1 = !res_0;
   }
   else {
      t_1 = false;
   }
   if (t_1) {
      _fx_FPS1R9Ast__id_t __lambda___fp_0 = { _fx_M11K_normalizeFM10__lambda__S1R9Ast__id_t, 0 };
      FX_COPY_FP(&__lambda___fp_0, &__lambda___0);
      FX_CALL(_fx_M11K_normalizeFM3mapLS2Rt6Set__t1R9Ast__id_tFPS1R9Ast__id_t(match_var_cases_0, &__lambda___0, &v_3, 0),
         _fx_cleanup);
      fx_str_t slit_2 = FX_MAKE_STR(", ");
      FX_CALL(_fx_M11K_normalizeFM4joinS2SLS(&slit_2, v_3, &idlist_0, 0), _fx_cleanup);
      int_ idlist_len_0;
      FX_CALL(_fx_M11K_normalizeFM6lengthi1S(&idlist_0, &idlist_len_0, 0), _fx_cleanup);
      if (idlist_len_0 == 1) {
         FX_CALL(_fx_M11K_normalizeFM6stringS1S(&idlist_0, &v_4, 0), _fx_cleanup);
         fx_str_t slit_3 = FX_MAKE_STR("the case ");
         fx_str_t slit_4 = FX_MAKE_STR(" is not covered");
         {
            const fx_str_t strs_0[] = { slit_3, v_4, slit_4 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &msg_0), _fx_cleanup);
         }
      }
      else {
         FX_CALL(_fx_M11K_normalizeFM6stringS1S(&idlist_0, &v_5, 0), _fx_cleanup);
         fx_str_t slit_5 = FX_MAKE_STR("the cases [");
         fx_str_t slit_6 = FX_MAKE_STR("] are not covered");
         {
            const fx_str_t strs_1[] = { slit_5, v_5, slit_6 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &msg_0), _fx_cleanup);
         }
      }
      FX_CALL(_fx_M11K_normalizeFM6stringS1S(&msg_0, &v_6, 0), _fx_cleanup);
      fx_str_t slit_7 = FX_MAKE_STR("; add \'| _ => ...\' clause to suppress this error");
      {
         const fx_str_t strs_2[] = { v_6, slit_7 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_2, 2, &v_7), _fx_cleanup);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_7, &v_8, 0), _fx_cleanup);
      FX_THROW(&v_8, false, _fx_cleanup);
   }
   if (have_else_0) {
      FX_COPY_PTR(k_cases_0, &k_cases_1);
   }
   else if (catch_mode_0) {
      _fx_R9Ast__id_t v_28;
      fx_str_t slit_8 = FX_MAKE_STR("internal error: a literal cannot occur here");
      FX_CALL(_fx_M6K_formFM7atom2idR9Ast__id_t3N14K_form__atom_tR10Ast__loc_tS(a_0, loc_0, &slit_8, &v_28, 0), _fx_cleanup);
      FX_CALL(_fx_M6K_formFM9KExpThrowN14K_form__kexp_t3R9Ast__id_tBR10Ast__loc_t(&v_28, true, loc_0, &rethrow_exp_0),
         _fx_cleanup);
      _fx_make_T2LN14K_form__kexp_tN14K_form__kexp_t(0, rethrow_exp_0, &v_9);
      FX_CALL(_fx_cons_LT2LN14K_form__kexp_tN14K_form__kexp_t(&v_9, 0, true, &v_10), _fx_cleanup);
      FX_CALL(
         _fx_M11K_normalizeFM7__add__LT2LN14K_form__kexp_tN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tLT2LN14K_form__kexp_tN14K_form__kexp_t(
            k_cases_0, v_10, &k_cases_1, 0), _fx_cleanup);
   }
   else {
      bool res_1;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&_fx_g32K_form__builtin_exn_NoMatchError, &_fx_g9Ast__noid, &res_1, 0),
         _fx_cleanup);
      if (res_1) {
         fx_str_t slit_9 = FX_MAKE_STR("internal error: NoMatchError exception is not found");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_9, &v_11, 0), _fx_cleanup);
         FX_THROW(&v_11, false, _fx_cleanup);
      }
      FX_CALL(
         _fx_M6K_formFM9KExpThrowN14K_form__kexp_t3R9Ast__id_tBR10Ast__loc_t(&_fx_g32K_form__builtin_exn_NoMatchError, false,
            loc_0, &nomatch_err_0), _fx_cleanup);
      _fx_make_T2LN14K_form__kexp_tN14K_form__kexp_t(0, nomatch_err_0, &v_12);
      FX_CALL(_fx_cons_LT2LN14K_form__kexp_tN14K_form__kexp_t(&v_12, 0, true, &v_13), _fx_cleanup);
      FX_CALL(
         _fx_M11K_normalizeFM7__add__LT2LN14K_form__kexp_tN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tLT2LN14K_form__kexp_tN14K_form__kexp_t(
            k_cases_0, v_13, &k_cases_1, 0), _fx_cleanup);
   }
   _fx_make_T2LT2LN14K_form__kexp_tN14K_form__kexp_tLN14K_form__kexp_t(k_cases_1, code_2, fx_result);

_fx_cleanup: ;
   if (match_var_cases_ref_0) {
      _fx_free_rRt6Set__t1R9Ast__id_t(&match_var_cases_ref_0);
   }
   if (atyp_0) {
      _fx_free_N14K_form__ktyp_t(&atyp_0);
   }
   _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_0);
   if (extract_tag_exp_0) {
      _fx_free_N14K_form__kexp_t(&extract_tag_exp_0);
   }
   _fx_free_R16Ast__val_flags_t(&v_1);
   _fx_free_Nt6option1N14K_form__kexp_t(&v_2);
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   if (code_2) {
      _fx_free_LN14K_form__kexp_t(&code_2);
   }
   if (k_cases_0) {
      _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&k_cases_0);
   }
   FX_FREE_FP(&__lambda___0);
   if (v_3) {
      _fx_free_LS(&v_3);
   }
   FX_FREE_STR(&idlist_0);
   FX_FREE_STR(&msg_0);
   FX_FREE_STR(&v_4);
   FX_FREE_STR(&v_5);
   FX_FREE_STR(&v_6);
   FX_FREE_STR(&v_7);
   fx_free_exn(&v_8);
   if (k_cases_1) {
      _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&k_cases_1);
   }
   if (rethrow_exp_0) {
      _fx_free_N14K_form__kexp_t(&rethrow_exp_0);
   }
   _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t(&v_9);
   if (v_10) {
      _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&v_10);
   }
   fx_free_exn(&v_11);
   if (nomatch_err_0) {
      _fx_free_N14K_form__kexp_t(&nomatch_err_0);
   }
   _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t(&v_12);
   if (v_13) {
      _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&v_13);
   }
   return fx_status;
}

static int
   _fx_M11K_normalizeFM19process_next_subpatTa2LN14K_form__kexp_t6Ta3LRM10pat_info_tTa2LN14K_form__kexp_tLN12Ast__scope_tirRt6Set__t1R9Ast__id_tLN12Ast__scope_t(
   struct _fx_Ta3LR23K_normalize__pat_info_t* plists_0,
   struct _fx_Ta2LN14K_form__kexp_t* arg1_0,
   struct _fx_LN12Ast__scope_t_data_t* case_sc_0,
   int_ km_idx_0,
   struct _fx_rRt6Set__t1R9Ast__id_t_data_t* match_var_cases_ref_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_Ta2LN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_Ta2LN14K_form__kexp_t result_0 = {0};
   _fx_Ta3LR23K_normalize__pat_info_t plists_1 = {0};
   _fx_Ta2LN14K_form__kexp_t arg1_1 = {0};
   _fx_LN12Ast__scope_t case_sc_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_Rt6Set__t1R9Ast__id_t* match_var_cases_0 = &match_var_cases_ref_0->data;
   _fx_copy_Ta3LR23K_normalize__pat_info_t(plists_0, &plists_1);
   _fx_copy_Ta2LN14K_form__kexp_t(arg1_0, &arg1_1);
   FX_COPY_PTR(case_sc_0, &case_sc_1);
   for (;;) {
      _fx_Ta3LR23K_normalize__pat_info_t plists_2 = {0};
      _fx_Ta2LN14K_form__kexp_t arg1_2 = {0};
      _fx_LN12Ast__scope_t case_sc_2 = 0;
      _fx_LN14K_form__kexp_t checks_0 = 0;
      _fx_LN14K_form__kexp_t code_0 = 0;
      _fx_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t v_0 = {0};
      _fx_Nt6option1R23K_normalize__pat_info_t p_opt_0 = {0};
      _fx_Ta3LR23K_normalize__pat_info_t plists_3 = {0};
      _fx_copy_Ta3LR23K_normalize__pat_info_t(&plists_1, &plists_2);
      _fx_copy_Ta2LN14K_form__kexp_t(&arg1_1, &arg1_2);
      FX_COPY_PTR(case_sc_1, &case_sc_2);
      FX_COPY_PTR(arg1_2.t0, &checks_0);
      FX_COPY_PTR(arg1_2.t1, &code_0);
      _fx_LR23K_normalize__pat_info_t v_1 = plists_2.t0;
      if (v_1 != 0) {
         _fx_Nt6option1R23K_normalize__pat_info_t v_2 = {0};
         _fx_Ta3LR23K_normalize__pat_info_t v_3 = {0};
         _fx_M11K_normalizeFM4SomeNt6option1RM10pat_info_t1RM10pat_info_t(&v_1->hd, &v_2);
         _fx_make_Ta3LR23K_normalize__pat_info_t(v_1->tl, plists_2.t1, plists_2.t2, &v_3);
         _fx_make_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t(&v_2, &v_3, &v_0);
         _fx_free_Ta3LR23K_normalize__pat_info_t(&v_3);
         _fx_free_Nt6option1R23K_normalize__pat_info_t(&v_2);
         goto _fx_endmatch_0;
      }
      if (plists_2.t0 == 0) {
         _fx_LR23K_normalize__pat_info_t v_4 = plists_2.t1;
         if (v_4 != 0) {
            _fx_Nt6option1R23K_normalize__pat_info_t v_5 = {0};
            _fx_Ta3LR23K_normalize__pat_info_t v_6 = {0};
            _fx_M11K_normalizeFM4SomeNt6option1RM10pat_info_t1RM10pat_info_t(&v_4->hd, &v_5);
            _fx_make_Ta3LR23K_normalize__pat_info_t(0, v_4->tl, plists_2.t2, &v_6);
            _fx_make_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t(&v_5, &v_6, &v_0);
            _fx_free_Ta3LR23K_normalize__pat_info_t(&v_6);
            _fx_free_Nt6option1R23K_normalize__pat_info_t(&v_5);
            goto _fx_endmatch_0;
         }
      }
      if (plists_2.t1 == 0) {
         if (plists_2.t0 == 0) {
            _fx_LR23K_normalize__pat_info_t v_7 = plists_2.t2;
            if (v_7 != 0) {
               _fx_Nt6option1R23K_normalize__pat_info_t v_8 = {0};
               _fx_Ta3LR23K_normalize__pat_info_t v_9 = {0};
               _fx_M11K_normalizeFM4SomeNt6option1RM10pat_info_t1RM10pat_info_t(&v_7->hd, &v_8);
               _fx_make_Ta3LR23K_normalize__pat_info_t(0, 0, v_7->tl, &v_9);
               _fx_make_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t(&v_8, &v_9, &v_0);
               _fx_free_Ta3LR23K_normalize__pat_info_t(&v_9);
               _fx_free_Nt6option1R23K_normalize__pat_info_t(&v_8);
               goto _fx_endmatch_0;
            }
         }
      }
      _fx_Ta3LR23K_normalize__pat_info_t v_10 = {0};
      _fx_make_Ta3LR23K_normalize__pat_info_t(0, 0, 0, &v_10);
      _fx_make_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t(&_fx_g17K_normalize__None, &v_10, &v_0);
      _fx_free_Ta3LR23K_normalize__pat_info_t(&v_10);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_21);
      _fx_copy_Nt6option1R23K_normalize__pat_info_t(&v_0.t0, &p_opt_0);
      _fx_copy_Ta3LR23K_normalize__pat_info_t(&v_0.t1, &plists_3);
      if (p_opt_0.tag == 2) {
         _fx_N14K_form__kexp_t ke_0 = 0;
         _fx_N14K_form__ktyp_t ptyp_0 = 0;
         _fx_N10Ast__pat_t p_0 = 0;
         _fx_T4N10Ast__pat_tR9Ast__id_tBB v_11 = {0};
         _fx_N10Ast__pat_t p_1 = 0;
         _fx_Ta2LN14K_form__kexp_t v_12 = {0};
         _fx_T2R9Ast__id_tLN14K_form__kexp_t v_13 = {0};
         _fx_LN14K_form__kexp_t code_1 = 0;
         _fx_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t v_14 = {0};
         _fx_Ta3LR23K_normalize__pat_info_t plists_4 = {0};
         _fx_LN14K_form__kexp_t checks_1 = 0;
         _fx_LN14K_form__kexp_t code_2 = 0;
         _fx_Ta2LN14K_form__kexp_t v_15 = {0};
         _fx_R23K_normalize__pat_info_t* pinfo_0 = &p_opt_0.u.Some;
         _fx_R9Ast__id_t var_tag0_0 = pinfo_0->pinfo_tag;
         FX_COPY_PTR(pinfo_0->pinfo_e, &ke_0);
         FX_COPY_PTR(pinfo_0->pinfo_typ, &ptyp_0);
         FX_COPY_PTR(pinfo_0->pinfo_p, &p_0);
         fx_str_t slit_0 = FX_MAKE_STR("v");
         FX_CALL(
            _fx_M11K_normalizeFM14pat_propose_idT4N10Ast__pat_tR9Ast__id_tBB6N10Ast__pat_tN14K_form__ktyp_tSBBLN12Ast__scope_t(
               p_0, ptyp_0, &slit_0, false, false, case_sc_2, &v_11, 0), _fx_catch_19);
         FX_COPY_PTR(v_11.t0, &p_1);
         _fx_R9Ast__id_t n_0 = v_11.t1;
         bool tref_0 = v_11.t2;
         bool res_0;
         FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&n_0, &_fx_g9Ast__noid, &res_0, 0), _fx_catch_19);
         if (res_0) {
            _fx_make_Ta2LN14K_form__kexp_t(checks_0, code_0, &v_12);
            _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_1);
            _fx_copy_Ta3LR23K_normalize__pat_info_t(&plists_3, &plists_1);
            _fx_free_Ta2LN14K_form__kexp_t(&arg1_1);
            _fx_copy_Ta2LN14K_form__kexp_t(&v_12, &arg1_1);
            FX_FREE_LIST_SIMPLE(&case_sc_1);
            FX_COPY_PTR(case_sc_2, &case_sc_1);
         }
         else {
            _fx_R10Ast__loc_t loc_0;
            FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(p_1, &loc_0, 0), _fx_catch_19);
            if (tref_0 == true) {
               if (FX_REC_VARIANT_TAG(ke_0) == 5) {
                  _fx_N14K_form__atom_t* v_16 = &ke_0->u.KExpAtom.t0;
                  if (v_16->tag == 1) {
                     _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&v_16->u.AtomId, code_0, &v_13); goto _fx_endmatch_2;
                  }
               }
            }
            _fx_R16Ast__val_flags_t flags_0 = {0};
            _fx_Nt6option1N14K_form__kexp_t v_17 = {0};
            _fx_LN14K_form__kexp_t code_3 = 0;
            bool res_1;
            FX_CALL(_fx_M6K_formFM14is_ktyp_scalarB1N14K_form__ktyp_t(ptyp_0, &res_1, 0), _fx_catch_0);
            bool t_0;
            if (res_1) {
               t_0 = true;
            }
            else {
               if (FX_REC_VARIANT_TAG(ke_0) == 7) {
                  if (ke_0->u.KExpUnary.t0.tag == 7) {
                     t_0 = true; goto _fx_endmatch_1;
                  }
               }
               t_0 = false;

            _fx_endmatch_1: ;
               FX_CHECK_EXN(_fx_catch_0);
            }
            if (t_0) {
               FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&flags_0, 0), _fx_catch_0);
            }
            else {
               FX_CALL(_fx_M3AstFM21default_tempref_flagsRM11val_flags_t0(&flags_0, 0), _fx_catch_0);
            }
            _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(ke_0, &v_17);
            FX_CALL(
               _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
                  &n_0, ptyp_0, &flags_0, &v_17, code_0, &loc_0, &code_3, 0), _fx_catch_0);
            _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&n_0, code_3, &v_13);

         _fx_catch_0: ;
            if (code_3) {
               _fx_free_LN14K_form__kexp_t(&code_3);
            }
            _fx_free_Nt6option1N14K_form__kexp_t(&v_17);
            _fx_free_R16Ast__val_flags_t(&flags_0);

         _fx_endmatch_2: ;
            FX_CHECK_EXN(_fx_catch_19);
            _fx_R9Ast__id_t n_1 = v_13.t0;
            FX_COPY_PTR(v_13.t1, &code_1);
            int tag_0 = FX_REC_VARIANT_TAG(p_1);
            if (tag_0 == 2) {
               _fx_N13Ast__binary_t v_18 = 0;
               _fx_N14K_form__atom_t v_19 = {0};
               _fx_N14K_form__klit_t v_20 = {0};
               _fx_N14K_form__atom_t v_21 = {0};
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_22 = {0};
               _fx_N14K_form__kexp_t v_23 = 0;
               _fx_LN14K_form__kexp_t code_4 = 0;
               _fx_N14K_form__kexp_t c_exp_0 = 0;
               _fx_LN14K_form__kexp_t v_24 = 0;
               FX_CALL(_fx_M3AstFM5OpCmpN13Ast__binary_t1N12Ast__cmpop_t(&_fx_g18K_normalize__CmpEQ, &v_18), _fx_catch_1);
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_1, &v_19);
               FX_CALL(
                  _fx_M11K_normalizeFM8lit2klitN14K_form__klit_t3N10Ast__lit_tN14K_form__ktyp_tR10Ast__loc_t(&p_1->u.PatLit.t0,
                     ptyp_0, &loc_0, &v_20, 0), _fx_catch_1);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_20, &v_21);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypBool, &loc_0, &v_22);
               FX_CALL(
                  _fx_M6K_formFM10KExpBinaryN14K_form__kexp_t4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
                     v_18, &v_19, &v_21, &v_22, &v_23), _fx_catch_1);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(v_23, code_1, true, &code_4), _fx_catch_1);
               FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(code_4, &loc_0, &c_exp_0, 0),
                  _fx_catch_1);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(c_exp_0, checks_0, true, &v_24), _fx_catch_1);
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&plists_3, v_24, 0, &v_14);

            _fx_catch_1: ;
               if (v_24) {
                  _fx_free_LN14K_form__kexp_t(&v_24);
               }
               if (c_exp_0) {
                  _fx_free_N14K_form__kexp_t(&c_exp_0);
               }
               if (code_4) {
                  _fx_free_LN14K_form__kexp_t(&code_4);
               }
               if (v_23) {
                  _fx_free_N14K_form__kexp_t(&v_23);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_22);
               _fx_free_N14K_form__atom_t(&v_21);
               _fx_free_N14K_form__klit_t(&v_20);
               _fx_free_N14K_form__atom_t(&v_19);
               if (v_18) {
                  _fx_free_N13Ast__binary_t(&v_18);
               }
            }
            else if (tag_0 == 3) {
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&plists_3, checks_0, code_1,
                  &v_14);
            }
            else if (tag_0 == 7) {
               _fx_N13Ast__binary_t v_25 = 0;
               _fx_N14K_form__atom_t v_26 = {0};
               _fx_N14K_form__klit_t v_27 = {0};
               _fx_N14K_form__atom_t v_28 = {0};
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_29 = {0};
               _fx_N14K_form__kexp_t v_30 = 0;
               _fx_LN14K_form__kexp_t code_5 = 0;
               _fx_N14K_form__kexp_t c_exp_1 = 0;
               _fx_N14K_form__ktyp_t et_0 = 0;
               _fx_N14K_form__atom_t v_31 = {0};
               _fx_LN14K_form__atom_t v_32 = 0;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_33 = {0};
               _fx_N14K_form__kexp_t get_hd_exp_0 = 0;
               _fx_N14K_form__atom_t v_34 = {0};
               _fx_LN14K_form__atom_t v_35 = 0;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_36 = {0};
               _fx_N14K_form__kexp_t get_tl_exp_0 = 0;
               _fx_R23K_normalize__pat_info_t p_hd_0 = {0};
               _fx_R23K_normalize__pat_info_t p_tl_0 = {0};
               _fx_Ta3LR23K_normalize__pat_info_t plists_5 = {0};
               _fx_Ta3LR23K_normalize__pat_info_t plists_6 = {0};
               _fx_LN14K_form__kexp_t v_37 = 0;
               _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* vcase_0 = &p_1->u.PatCons;
               FX_CALL(_fx_M3AstFM5OpCmpN13Ast__binary_t1N12Ast__cmpop_t(&_fx_g18K_normalize__CmpNE, &v_25), _fx_catch_3);
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_1, &v_26);
               _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(ptyp_0, &v_27);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_27, &v_28);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypBool, &loc_0, &v_29);
               FX_CALL(
                  _fx_M6K_formFM10KExpBinaryN14K_form__kexp_t4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
                     v_25, &v_26, &v_28, &v_29, &v_30), _fx_catch_3);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(v_30, code_1, true, &code_5), _fx_catch_3);
               FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(code_5, &loc_0, &c_exp_1, 0),
                  _fx_catch_3);
               if (FX_REC_VARIANT_TAG(ptyp_0) == 19) {
                  FX_COPY_PTR(ptyp_0->u.KTypList, &et_0);
               }
               else {
                  fx_exn_t v_38 = {0};
                  fx_str_t slit_1 = FX_MAKE_STR("the pattern needs list type");
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_1, &v_38, 0), _fx_catch_2);
                  FX_THROW(&v_38, false, _fx_catch_2);

               _fx_catch_2: ;
                  fx_free_exn(&v_38);
               }
               FX_CHECK_EXN(_fx_catch_3);
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_1, &v_31);
               FX_CALL(_fx_cons_LN14K_form__atom_t(&v_31, 0, true, &v_32), _fx_catch_3);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(et_0, &loc_0, &v_33);
               FX_CALL(
                  _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
                     &_fx_g27K_normalize__IntrinListHead, v_32, &v_33, &get_hd_exp_0), _fx_catch_3);
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_1, &v_34);
               FX_CALL(_fx_cons_LN14K_form__atom_t(&v_34, 0, true, &v_35), _fx_catch_3);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ptyp_0, &loc_0, &v_36);
               FX_CALL(
                  _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
                     &_fx_g27K_normalize__IntrinListTail, v_35, &v_36, &get_tl_exp_0), _fx_catch_3);
               _fx_make_R23K_normalize__pat_info_t(vcase_0->t0, et_0, get_hd_exp_0, &_fx_g9Ast__noid, &p_hd_0);
               _fx_make_R23K_normalize__pat_info_t(vcase_0->t1, ptyp_0, get_tl_exp_0, &_fx_g9Ast__noid, &p_tl_0);
               FX_CALL(
                  _fx_M11K_normalizeFM12dispatch_patTa3LRM10pat_info_t2RM10pat_info_tTa3LRM10pat_info_t(&p_hd_0, &plists_3,
                     &plists_5, 0), _fx_catch_3);
               FX_CALL(
                  _fx_M11K_normalizeFM12dispatch_patTa3LRM10pat_info_t2RM10pat_info_tTa3LRM10pat_info_t(&p_tl_0, &plists_5,
                     &plists_6, 0), _fx_catch_3);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(c_exp_1, checks_0, true, &v_37), _fx_catch_3);
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&plists_6, v_37, 0, &v_14);

            _fx_catch_3: ;
               if (v_37) {
                  _fx_free_LN14K_form__kexp_t(&v_37);
               }
               _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_6);
               _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_5);
               _fx_free_R23K_normalize__pat_info_t(&p_tl_0);
               _fx_free_R23K_normalize__pat_info_t(&p_hd_0);
               if (get_tl_exp_0) {
                  _fx_free_N14K_form__kexp_t(&get_tl_exp_0);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_36);
               if (v_35) {
                  _fx_free_LN14K_form__atom_t(&v_35);
               }
               _fx_free_N14K_form__atom_t(&v_34);
               if (get_hd_exp_0) {
                  _fx_free_N14K_form__kexp_t(&get_hd_exp_0);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_33);
               if (v_32) {
                  _fx_free_LN14K_form__atom_t(&v_32);
               }
               _fx_free_N14K_form__atom_t(&v_31);
               if (et_0) {
                  _fx_free_N14K_form__ktyp_t(&et_0);
               }
               if (c_exp_1) {
                  _fx_free_N14K_form__kexp_t(&c_exp_1);
               }
               if (code_5) {
                  _fx_free_LN14K_form__kexp_t(&code_5);
               }
               if (v_30) {
                  _fx_free_N14K_form__kexp_t(&v_30);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_29);
               _fx_free_N14K_form__atom_t(&v_28);
               _fx_free_N14K_form__klit_t(&v_27);
               _fx_free_N14K_form__atom_t(&v_26);
               if (v_25) {
                  _fx_free_N13Ast__binary_t(&v_25);
               }
            }
            else if (tag_0 == 4) {
               _fx_LN14K_form__ktyp_t tl_0 = 0;
               _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti __fold_result___0 = 0;
               _fx_LN10Ast__pat_t pl_0 = 0;
               _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti pti_l_0 = 0;
               _fx_Ta3LR23K_normalize__pat_info_t plists_7 = {0};
               _fx_T2LN10Ast__pat_tR10Ast__loc_t* vcase_1 = &p_1->u.PatTuple;
               if (FX_REC_VARIANT_TAG(ptyp_0) == 14) {
                  FX_COPY_PTR(ptyp_0->u.KTypTuple, &tl_0);
               }
               else {
                  fx_exn_t v_39 = {0};
                  fx_str_t slit_2 = FX_MAKE_STR("invalid type of the tuple pattern (it must be a tuple as well)");
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&vcase_1->t1, &slit_2, &v_39, 0), _fx_catch_4);
                  FX_THROW(&v_39, false, _fx_catch_4);

               _fx_catch_4: ;
                  fx_free_exn(&v_39);
               }
               FX_CHECK_EXN(_fx_catch_6);
               int_ idx_0 = 0;
               FX_COPY_PTR(vcase_1->t0, &pl_0);
               _fx_LN10Ast__pat_t lst_0 = pl_0;
               _fx_LN14K_form__ktyp_t lst_1 = tl_0;
               for (; lst_0 && lst_1; lst_1 = lst_1->tl, lst_0 = lst_0->tl, idx_0 += 1) {
                  _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti pti_l_1 = 0;
                  _fx_T3N10Ast__pat_tN14K_form__ktyp_ti v_40 = {0};
                  _fx_N14K_form__ktyp_t ti_0 = lst_1->hd;
                  _fx_N10Ast__pat_t pi_0 = lst_0->hd;
                  FX_COPY_PTR(__fold_result___0, &pti_l_1);
                  _fx_make_T3N10Ast__pat_tN14K_form__ktyp_ti(pi_0, ti_0, idx_0, &v_40);
                  FX_CALL(_fx_cons_LT3N10Ast__pat_tN14K_form__ktyp_ti(&v_40, pti_l_1, false, &pti_l_1), _fx_catch_5);
                  _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(&__fold_result___0);
                  FX_COPY_PTR(pti_l_1, &__fold_result___0);

               _fx_catch_5: ;
                  _fx_free_T3N10Ast__pat_tN14K_form__ktyp_ti(&v_40);
                  if (pti_l_1) {
                     _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(&pti_l_1);
                  }
                  FX_CHECK_EXN(_fx_catch_6);
               }
               int s_0 = !lst_0 + !lst_1;
               FX_CHECK_EQ_SIZE(s_0 == 0 || s_0 == 2, _fx_catch_6);
               FX_COPY_PTR(__fold_result___0, &pti_l_0);
               FX_CALL(
                  _fx_M11K_normalizeFM16process_pat_listTa3LRM10pat_info_t4R9Ast__id_tLT3N10Ast__pat_tN14K_form__ktyp_tiTa3LRM10pat_info_tNt6option1N14K_form__kexp_t(
                     &n_1, pti_l_0, &plists_3, &_fx_g19K_normalize__None3_, &plists_7, 0), _fx_catch_6);
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&plists_7, checks_0, code_1,
                  &v_14);

            _fx_catch_6: ;
               _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_7);
               if (pti_l_0) {
                  _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(&pti_l_0);
               }
               if (pl_0) {
                  _fx_free_LN10Ast__pat_t(&pl_0);
               }
               if (__fold_result___0) {
                  _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(&__fold_result___0);
               }
               if (tl_0) {
                  _fx_free_LN14K_form__ktyp_t(&tl_0);
               }
            }
            else if (tag_0 == 5) {
               _fx_Ta2LN14K_form__kexp_t v_41 = {0};
               _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t v_42 = {0};
               _fx_LN14K_form__ktyp_t tl_1 = 0;
               _fx_LN14K_form__kexp_t checks_2 = 0;
               _fx_LN14K_form__kexp_t code_6 = 0;
               _fx_Nt6option1N14K_form__kexp_t alt_e_opt_0 = {0};
               _fx_Ta3LR23K_normalize__pat_info_t plists_8 = {0};
               _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti __fold_result___1 = 0;
               _fx_LN10Ast__pat_t pl_1 = 0;
               _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti pti_l_2 = 0;
               _fx_Rt6Set__t1R9Ast__id_t v_43 = {0};
               _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* vcase_2 = &p_1->u.PatVariant;
               _fx_LN10Ast__pat_t pl_2 = vcase_2->t1;
               _fx_R9Ast__id_t* vn_0 = &vcase_2->t0;
               _fx_make_Ta2LN14K_form__kexp_t(checks_0, code_1, &v_41);
               FX_CALL(
                  _fx_M11K_normalizeFM27get_var_tag_cmp_and_extractT5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t7R9Ast__id_tRM10pat_info_tTa2LN14K_form__kexp_tR9Ast__id_tLN12Ast__scope_tR10Ast__loc_ti(
                     &n_1, pinfo_0, &v_41, vn_0, case_sc_2, &vcase_2->t2, km_idx_0, &v_42, 0), _fx_catch_8);
               _fx_R9Ast__id_t case_n_0 = v_42.t0;
               FX_COPY_PTR(v_42.t1, &tl_1);
               FX_COPY_PTR(v_42.t2, &checks_2);
               FX_COPY_PTR(v_42.t3, &code_6);
               _fx_copy_Nt6option1N14K_form__kexp_t(&v_42.t4, &alt_e_opt_0);
               bool res_2;
               if (pl_2 != 0) {
                  if (pl_2->tl == 0) {
                     if (FX_REC_VARIANT_TAG(pl_2->hd) == 1) {
                        res_2 = true; goto _fx_endmatch_3;
                     }
                  }
               }
               res_2 = false;

            _fx_endmatch_3: ;
               FX_CHECK_EXN(_fx_catch_8);
               bool t_1;
               if (res_2) {
                  t_1 = true;
               }
               else {
                  bool res_3;
                  FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&case_n_0, &_fx_g9Ast__noid, &res_3, 0), _fx_catch_8);
                  if (res_3) {
                     FX_CALL(_fx_M11K_normalizeFM6isnoneB1Nt6option1N14K_form__kexp_t(&alt_e_opt_0, &t_1, 0), _fx_catch_8);
                  }
                  else {
                     t_1 = false;
                  }
               }
               if (t_1) {
                  _fx_copy_Ta3LR23K_normalize__pat_info_t(&plists_3, &plists_8);
               }
               else {
                  int_ idx_1 = 0;
                  FX_COPY_PTR(pl_2, &pl_1);
                  _fx_LN10Ast__pat_t lst_2 = pl_1;
                  _fx_LN14K_form__ktyp_t lst_3 = tl_1;
                  for (; lst_2 && lst_3; lst_3 = lst_3->tl, lst_2 = lst_2->tl, idx_1 += 1) {
                     _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti pti_l_3 = 0;
                     _fx_T3N10Ast__pat_tN14K_form__ktyp_ti v_44 = {0};
                     _fx_N14K_form__ktyp_t ti_1 = lst_3->hd;
                     _fx_N10Ast__pat_t pi_1 = lst_2->hd;
                     FX_COPY_PTR(__fold_result___1, &pti_l_3);
                     _fx_make_T3N10Ast__pat_tN14K_form__ktyp_ti(pi_1, ti_1, idx_1, &v_44);
                     FX_CALL(_fx_cons_LT3N10Ast__pat_tN14K_form__ktyp_ti(&v_44, pti_l_3, false, &pti_l_3), _fx_catch_7);
                     _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(&__fold_result___1);
                     FX_COPY_PTR(pti_l_3, &__fold_result___1);

                  _fx_catch_7: ;
                     _fx_free_T3N10Ast__pat_tN14K_form__ktyp_ti(&v_44);
                     if (pti_l_3) {
                        _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(&pti_l_3);
                     }
                     FX_CHECK_EXN(_fx_catch_8);
                  }
                  int s_1 = !lst_2 + !lst_3;
                  FX_CHECK_EQ_SIZE(s_1 == 0 || s_1 == 2, _fx_catch_8);
                  FX_COPY_PTR(__fold_result___1, &pti_l_2);
                  FX_CALL(
                     _fx_M11K_normalizeFM16process_pat_listTa3LRM10pat_info_t4R9Ast__id_tLT3N10Ast__pat_tN14K_form__ktyp_tiTa3LRM10pat_info_tNt6option1N14K_form__kexp_t(
                        &case_n_0, pti_l_2, &plists_3, &alt_e_opt_0, &plists_8, 0), _fx_catch_8);
               }
               _fx_R9Ast__id_t v_45;
               FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(vn_0, &v_45, 0), _fx_catch_8);
               FX_CALL(
                  _fx_M11K_normalizeFM6removeRt6Set__t1R9Ast__id_t2Rt6Set__t1R9Ast__id_tR9Ast__id_t(match_var_cases_0, &v_45,
                     &v_43, 0), _fx_catch_8);
               _fx_free_Rt6Set__t1R9Ast__id_t(match_var_cases_0);
               _fx_copy_Rt6Set__t1R9Ast__id_t(&v_43, match_var_cases_0);
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&plists_8, checks_2, code_6,
                  &v_14);

            _fx_catch_8: ;
               _fx_free_Rt6Set__t1R9Ast__id_t(&v_43);
               if (pti_l_2) {
                  _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(&pti_l_2);
               }
               if (pl_1) {
                  _fx_free_LN10Ast__pat_t(&pl_1);
               }
               if (__fold_result___1) {
                  _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(&__fold_result___1);
               }
               _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_8);
               _fx_free_Nt6option1N14K_form__kexp_t(&alt_e_opt_0);
               if (code_6) {
                  _fx_free_LN14K_form__kexp_t(&code_6);
               }
               if (checks_2) {
                  _fx_free_LN14K_form__kexp_t(&checks_2);
               }
               if (tl_1) {
                  _fx_free_LN14K_form__ktyp_t(&tl_1);
               }
               _fx_free_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(&v_42);
               _fx_free_Ta2LN14K_form__kexp_t(&v_41);
            }
            else if (tag_0 == 6) {
               _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t v_46 = {0};
               _fx_LN14K_form__kexp_t checks_3 = 0;
               _fx_LN14K_form__kexp_t code_7 = 0;
               _fx_Nt6option1N14K_form__kexp_t alt_e_opt_1 = {0};
               _fx_Ta3LR23K_normalize__pat_info_t plists_9 = {0};
               _fx_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti v_47 = {0};
               _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti ktyp_rec_pl_0 = 0;
               _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti pti_l_4 = 0;
               _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* vcase_3 = &p_1->u.PatRecord;
               _fx_Nt6option1R9Ast__id_t* rn_opt_0 = &vcase_3->t0;
               if (rn_opt_0->tag == 2) {
                  _fx_Rt6Set__t1R9Ast__id_t v_48 = {0};
                  _fx_Ta2LN14K_form__kexp_t v_49 = {0};
                  _fx_R9Ast__id_t* rn_0 = &rn_opt_0->u.Some;
                  _fx_R9Ast__id_t v_50;
                  FX_CALL(_fx_M3AstFM11get_orig_idRM4id_t1RM4id_t(rn_0, &v_50, 0), _fx_catch_9);
                  FX_CALL(
                     _fx_M11K_normalizeFM6removeRt6Set__t1R9Ast__id_t2Rt6Set__t1R9Ast__id_tR9Ast__id_t(match_var_cases_0, &v_50,
                        &v_48, 0), _fx_catch_9);
                  _fx_free_Rt6Set__t1R9Ast__id_t(match_var_cases_0);
                  _fx_copy_Rt6Set__t1R9Ast__id_t(&v_48, match_var_cases_0);
                  _fx_make_Ta2LN14K_form__kexp_t(checks_0, code_1, &v_49);
                  FX_CALL(
                     _fx_M11K_normalizeFM27get_var_tag_cmp_and_extractT5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t7R9Ast__id_tRM10pat_info_tTa2LN14K_form__kexp_tR9Ast__id_tLN12Ast__scope_tR10Ast__loc_ti(
                        &n_1, pinfo_0, &v_49, rn_0, case_sc_2, &vcase_3->t2, km_idx_0, &v_46, 0), _fx_catch_9);

               _fx_catch_9: ;
                  _fx_free_Ta2LN14K_form__kexp_t(&v_49);
                  _fx_free_Rt6Set__t1R9Ast__id_t(&v_48);
               }
               else {
                  _fx_make_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(&n_1,
                     0, checks_0, code_1, &_fx_g19K_normalize__None3_, &v_46);
               }
               FX_CHECK_EXN(_fx_catch_11);
               _fx_R9Ast__id_t case_n_1 = v_46.t0;
               FX_COPY_PTR(v_46.t2, &checks_3);
               FX_COPY_PTR(v_46.t3, &code_7);
               _fx_copy_Nt6option1N14K_form__kexp_t(&v_46.t4, &alt_e_opt_1);
               bool res_4;
               FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&case_n_1, &_fx_g9Ast__noid, &res_4, 0), _fx_catch_11);
               bool t_2;
               if (res_4) {
                  FX_CALL(_fx_M11K_normalizeFM6isnoneB1Nt6option1N14K_form__kexp_t(&alt_e_opt_1, &t_2, 0), _fx_catch_11);
               }
               else {
                  t_2 = false;
               }
               if (t_2) {
                  _fx_copy_Ta3LR23K_normalize__pat_info_t(&plists_3, &plists_9);
               }
               else {
                  FX_CALL(
                     _fx_M11K_normalizeFM16match_record_patT2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti2N10Ast__pat_tN14K_form__ktyp_t(
                        p_1, ptyp_0, &v_47, 0), _fx_catch_11);
                  FX_COPY_PTR(v_47.t1, &ktyp_rec_pl_0);
                  _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti lstend_0 = 0;
                  _fx_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti lst_4 = ktyp_rec_pl_0;
                  for (; lst_4; lst_4 = lst_4->tl) {
                     _fx_N10Ast__pat_t pi_2 = 0;
                     _fx_N14K_form__ktyp_t ti_2 = 0;
                     _fx_T3N10Ast__pat_tN14K_form__ktyp_ti tup_0 = {0};
                     _fx_T4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti* __pat___0 = &lst_4->hd;
                     FX_COPY_PTR(__pat___0->t1, &pi_2);
                     FX_COPY_PTR(__pat___0->t2, &ti_2);
                     _fx_make_T3N10Ast__pat_tN14K_form__ktyp_ti(pi_2, ti_2, __pat___0->t3, &tup_0);
                     _fx_LT3N10Ast__pat_tN14K_form__ktyp_ti node_0 = 0;
                     FX_CALL(_fx_cons_LT3N10Ast__pat_tN14K_form__ktyp_ti(&tup_0, 0, false, &node_0), _fx_catch_10);
                     FX_LIST_APPEND(pti_l_4, lstend_0, node_0);

                  _fx_catch_10: ;
                     _fx_free_T3N10Ast__pat_tN14K_form__ktyp_ti(&tup_0);
                     if (ti_2) {
                        _fx_free_N14K_form__ktyp_t(&ti_2);
                     }
                     if (pi_2) {
                        _fx_free_N10Ast__pat_t(&pi_2);
                     }
                     FX_CHECK_EXN(_fx_catch_11);
                  }
                  FX_CALL(
                     _fx_M11K_normalizeFM16process_pat_listTa3LRM10pat_info_t4R9Ast__id_tLT3N10Ast__pat_tN14K_form__ktyp_tiTa3LRM10pat_info_tNt6option1N14K_form__kexp_t(
                        &case_n_1, pti_l_4, &plists_3, &alt_e_opt_1, &plists_9, 0), _fx_catch_11);
               }
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&plists_9, checks_3, code_7,
                  &v_14);

            _fx_catch_11: ;
               if (pti_l_4) {
                  _fx_free_LT3N10Ast__pat_tN14K_form__ktyp_ti(&pti_l_4);
               }
               if (ktyp_rec_pl_0) {
                  _fx_free_LT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&ktyp_rec_pl_0);
               }
               _fx_free_T2T5R9Ast__id_tiN14K_form__ktyp_tBBLT4R9Ast__id_tN10Ast__pat_tN14K_form__ktyp_ti(&v_47);
               _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_9);
               _fx_free_Nt6option1N14K_form__kexp_t(&alt_e_opt_1);
               if (code_7) {
                  _fx_free_LN14K_form__kexp_t(&code_7);
               }
               if (checks_3) {
                  _fx_free_LN14K_form__kexp_t(&checks_3);
               }
               _fx_free_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(&v_46);
            }
            else if (tag_0 == 8) {
               _fx_N14K_form__atom_t v_51 = {0};
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_52 = {0};
               _fx_N14K_form__kexp_t v_53 = 0;
               _fx_R23K_normalize__pat_info_t pinfo_1 = {0};
               _fx_Ta3LR23K_normalize__pat_info_t plists_10 = {0};
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_1, &v_51);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ptyp_0, &loc_0, &v_52);
               FX_CALL(
                  _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_51, &v_52,
                     &v_53), _fx_catch_12);
               _fx_make_R23K_normalize__pat_info_t(p_1->u.PatAs.t0, ptyp_0, v_53, &var_tag0_0, &pinfo_1);
               FX_CALL(
                  _fx_M11K_normalizeFM12dispatch_patTa3LRM10pat_info_t2RM10pat_info_tTa3LRM10pat_info_t(&pinfo_1, &plists_3,
                     &plists_10, 0), _fx_catch_12);
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&plists_10, checks_0, code_1,
                  &v_14);

            _fx_catch_12: ;
               _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_10);
               _fx_free_R23K_normalize__pat_info_t(&pinfo_1);
               if (v_53) {
                  _fx_free_N14K_form__kexp_t(&v_53);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_52);
               _fx_free_N14K_form__atom_t(&v_51);
            }
            else if (tag_0 == 12) {
               _fx_N14K_form__ktyp_t t_3 = 0;
               _fx_N14K_form__atom_t v_54 = {0};
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_55 = {0};
               _fx_N14K_form__kexp_t get_val_0 = 0;
               _fx_R23K_normalize__pat_info_t pinfo_p_0 = {0};
               _fx_Ta3LR23K_normalize__pat_info_t plists_11 = {0};
               if (FX_REC_VARIANT_TAG(ptyp_0) == 20) {
                  FX_COPY_PTR(ptyp_0->u.KTypRef, &t_3);
               }
               else {
                  fx_exn_t v_56 = {0};
                  fx_str_t slit_3 = FX_MAKE_STR("the ref() pattern needs reference type");
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_3, &v_56, 0), _fx_catch_13);
                  FX_THROW(&v_56, false, _fx_catch_13);

               _fx_catch_13: ;
                  fx_free_exn(&v_56);
               }
               FX_CHECK_EXN(_fx_catch_14);
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_1, &v_54);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(t_3, &loc_0, &v_55);
               FX_CALL(
                  _fx_M6K_formFM9KExpUnaryN14K_form__kexp_t3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
                     &_fx_g20K_normalize__OpDeref, &v_54, &v_55, &get_val_0), _fx_catch_14);
               _fx_make_R23K_normalize__pat_info_t(p_1->u.PatRef.t0, t_3, get_val_0, &_fx_g9Ast__noid, &pinfo_p_0);
               FX_CALL(
                  _fx_M11K_normalizeFM12dispatch_patTa3LRM10pat_info_t2RM10pat_info_tTa3LRM10pat_info_t(&pinfo_p_0, &plists_3,
                     &plists_11, 0), _fx_catch_14);
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&plists_11, checks_0, code_1,
                  &v_14);

            _fx_catch_14: ;
               _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_11);
               _fx_free_R23K_normalize__pat_info_t(&pinfo_p_0);
               if (get_val_0) {
                  _fx_free_N14K_form__kexp_t(&get_val_0);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_55);
               _fx_free_N14K_form__atom_t(&v_54);
               if (t_3) {
                  _fx_free_N14K_form__ktyp_t(&t_3);
               }
            }
            else if (tag_0 == 10) {
               _fx_N14K_form__atom_t v_57 = {0};
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_58 = {0};
               _fx_N14K_form__kexp_t v_59 = 0;
               _fx_R23K_normalize__pat_info_t pinfo_2 = {0};
               _fx_Ta3LR23K_normalize__pat_info_t plists_12 = {0};
               _fx_Ta2LN14K_form__kexp_t v_60 = {0};
               _fx_Ta2LN14K_form__kexp_t v_61 = {0};
               _fx_LN14K_form__kexp_t checks_4 = 0;
               _fx_LN14K_form__kexp_t code_8 = 0;
               _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_62 = {0};
               _fx_N14K_form__kexp_t ke_1 = 0;
               _fx_LN14K_form__kexp_t code_9 = 0;
               _fx_LN14K_form__kexp_t v_63 = 0;
               _fx_N14K_form__kexp_t c_exp_2 = 0;
               _fx_Ta3LR23K_normalize__pat_info_t v_64 = {0};
               _fx_LN14K_form__kexp_t v_65 = 0;
               _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* vcase_4 = &p_1->u.PatWhen;
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_1, &v_57);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ptyp_0, &loc_0, &v_58);
               FX_CALL(
                  _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_57, &v_58,
                     &v_59), _fx_catch_15);
               _fx_make_R23K_normalize__pat_info_t(vcase_4->t0, ptyp_0, v_59, &var_tag0_0, &pinfo_2);
               FX_CALL(
                  _fx_M11K_normalizeFM12dispatch_patTa3LRM10pat_info_t2RM10pat_info_tTa3LRM10pat_info_t(&pinfo_2, &plists_3,
                     &plists_12, 0), _fx_catch_15);
               _fx_make_Ta2LN14K_form__kexp_t(checks_0, code_1, &v_60);
               FX_CALL(
                  _fx_M11K_normalizeFM19process_next_subpatTa2LN14K_form__kexp_t6Ta3LRM10pat_info_tTa2LN14K_form__kexp_tLN12Ast__scope_tirRt6Set__t1R9Ast__id_tLN12Ast__scope_t(
                     &plists_12, &v_60, case_sc_2, km_idx_0, match_var_cases_ref_0, sc_0, &v_61, 0), _fx_catch_15);
               FX_COPY_PTR(v_61.t0, &checks_4);
               FX_COPY_PTR(v_61.t1, &code_8);
               FX_CALL(
                  _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
                     vcase_4->t1, code_8, true, sc_0, &v_62, 0), _fx_catch_15);
               FX_COPY_PTR(v_62.t0, &ke_1);
               FX_COPY_PTR(v_62.t1, &code_9);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(ke_1, code_9, true, &v_63), _fx_catch_15);
               FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_63, &loc_0, &c_exp_2, 0),
                  _fx_catch_15);
               _fx_make_Ta3LR23K_normalize__pat_info_t(0, 0, 0, &v_64);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(c_exp_2, checks_4, true, &v_65), _fx_catch_15);
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&v_64, v_65, 0, &v_14);

            _fx_catch_15: ;
               if (v_65) {
                  _fx_free_LN14K_form__kexp_t(&v_65);
               }
               _fx_free_Ta3LR23K_normalize__pat_info_t(&v_64);
               if (c_exp_2) {
                  _fx_free_N14K_form__kexp_t(&c_exp_2);
               }
               if (v_63) {
                  _fx_free_LN14K_form__kexp_t(&v_63);
               }
               if (code_9) {
                  _fx_free_LN14K_form__kexp_t(&code_9);
               }
               if (ke_1) {
                  _fx_free_N14K_form__kexp_t(&ke_1);
               }
               _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_62);
               if (code_8) {
                  _fx_free_LN14K_form__kexp_t(&code_8);
               }
               if (checks_4) {
                  _fx_free_LN14K_form__kexp_t(&checks_4);
               }
               _fx_free_Ta2LN14K_form__kexp_t(&v_61);
               _fx_free_Ta2LN14K_form__kexp_t(&v_60);
               _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_12);
               _fx_free_R23K_normalize__pat_info_t(&pinfo_2);
               if (v_59) {
                  _fx_free_N14K_form__kexp_t(&v_59);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_58);
               _fx_free_N14K_form__atom_t(&v_57);
            }
            else if (tag_0 == 11) {
               fx_exn_t v_66 = {0};
               _fx_N14K_form__klit_t v_67 = {0};
               _fx_N14K_form__atom_t v_68 = {0};
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_69 = {0};
               _fx_N14K_form__kexp_t v_70 = 0;
               _fx_T2LN14K_form__kexp_tN14K_form__kexp_t v_71 = {0};
               _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t __fold_result___2 = 0;
               _fx_LN10Ast__pat_t v_72 = 0;
               _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t alt_cases_0 = 0;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_73 = {0};
               _fx_N14K_form__kexp_t v_74 = 0;
               _fx_LN14K_form__kexp_t v_75 = 0;
               _fx_N14K_form__kexp_t alt_check_0 = 0;
               _fx_LN14K_form__kexp_t v_76 = 0;
               bool v_77;
               FX_CALL(_fx_M11K_normalizeFM13pat_have_varsB1N10Ast__pat_t(p_1, &v_77, 0), _fx_catch_17);
               if (v_77) {
                  fx_str_t slit_4 = FX_MAKE_STR("alt-pattern cannot contain captured values");
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_4, &v_66, 0), _fx_catch_17);
                  FX_THROW(&v_66, false, _fx_catch_17);
               }
               _fx_M6K_formFM8KLitBoolN14K_form__klit_t1B(false, &v_67);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_67, &v_68);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypBool, &loc_0, &v_69);
               FX_CALL(
                  _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_68, &v_69,
                     &v_70), _fx_catch_17);
               _fx_make_T2LN14K_form__kexp_tN14K_form__kexp_t(0, v_70, &v_71);
               FX_CALL(_fx_cons_LT2LN14K_form__kexp_tN14K_form__kexp_t(&v_71, 0, true, &__fold_result___2), _fx_catch_17);
               FX_CALL(_fx_M11K_normalizeFM3revLN10Ast__pat_t1LN10Ast__pat_t(p_1->u.PatAlt.t0, &v_72, 0), _fx_catch_17);
               _fx_LN10Ast__pat_t lst_5 = v_72;
               for (; lst_5; lst_5 = lst_5->tl) {
                  _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t alt_cases_1 = 0;
                  _fx_N14K_form__atom_t v_78 = {0};
                  _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_79 = {0};
                  _fx_N14K_form__kexp_t v_80 = 0;
                  _fx_R23K_normalize__pat_info_t pinfo_3 = {0};
                  _fx_Ta3LR23K_normalize__pat_info_t v_81 = {0};
                  _fx_Ta3LR23K_normalize__pat_info_t plists__0 = {0};
                  _fx_Ta2LN14K_form__kexp_t v_82 = {0};
                  _fx_Ta2LN14K_form__kexp_t v_83 = {0};
                  _fx_LN14K_form__kexp_t checks__0 = 0;
                  _fx_LN14K_form__kexp_t code__0 = 0;
                  _fx_N14K_form__klit_t v_84 = {0};
                  _fx_N14K_form__atom_t v_85 = {0};
                  _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_86 = {0};
                  _fx_N14K_form__kexp_t v_87 = 0;
                  _fx_LN14K_form__kexp_t v_88 = 0;
                  _fx_N14K_form__kexp_t e_0 = 0;
                  _fx_LN14K_form__kexp_t v_89 = 0;
                  _fx_T2LN14K_form__kexp_tN14K_form__kexp_t v_90 = {0};
                  _fx_N10Ast__pat_t p_2 = lst_5->hd;
                  FX_COPY_PTR(__fold_result___2, &alt_cases_1);
                  _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_1, &v_78);
                  _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(ptyp_0, &loc_0, &v_79);
                  FX_CALL(
                     _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_78, &v_79,
                        &v_80), _fx_catch_16);
                  _fx_make_R23K_normalize__pat_info_t(p_2, ptyp_0, v_80, &var_tag0_0, &pinfo_3);
                  _fx_make_Ta3LR23K_normalize__pat_info_t(0, 0, 0, &v_81);
                  FX_CALL(
                     _fx_M11K_normalizeFM12dispatch_patTa3LRM10pat_info_t2RM10pat_info_tTa3LRM10pat_info_t(&pinfo_3, &v_81,
                        &plists__0, 0), _fx_catch_16);
                  _fx_make_Ta2LN14K_form__kexp_t(0, 0, &v_82);
                  FX_CALL(
                     _fx_M11K_normalizeFM19process_next_subpatTa2LN14K_form__kexp_t6Ta3LRM10pat_info_tTa2LN14K_form__kexp_tLN12Ast__scope_tirRt6Set__t1R9Ast__id_tLN12Ast__scope_t(
                        &plists__0, &v_82, case_sc_2, km_idx_0, match_var_cases_ref_0, sc_0, &v_83, 0), _fx_catch_16);
                  FX_COPY_PTR(v_83.t0, &checks__0);
                  FX_COPY_PTR(v_83.t1, &code__0);
                  _fx_M6K_formFM8KLitBoolN14K_form__klit_t1B(true, &v_84);
                  _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_84, &v_85);
                  _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypBool, &loc_0, &v_86);
                  FX_CALL(
                     _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_85, &v_86,
                        &v_87), _fx_catch_16);
                  FX_CALL(_fx_cons_LN14K_form__kexp_t(v_87, code__0, true, &v_88), _fx_catch_16);
                  FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_88, &loc_0, &e_0, 0),
                     _fx_catch_16);
                  FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__kexp_t1LN14K_form__kexp_t(checks__0, &v_89, 0), _fx_catch_16);
                  _fx_make_T2LN14K_form__kexp_tN14K_form__kexp_t(v_89, e_0, &v_90);
                  FX_CALL(_fx_cons_LT2LN14K_form__kexp_tN14K_form__kexp_t(&v_90, alt_cases_1, false, &alt_cases_1),
                     _fx_catch_16);
                  _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&__fold_result___2);
                  FX_COPY_PTR(alt_cases_1, &__fold_result___2);

               _fx_catch_16: ;
                  _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t(&v_90);
                  if (v_89) {
                     _fx_free_LN14K_form__kexp_t(&v_89);
                  }
                  if (e_0) {
                     _fx_free_N14K_form__kexp_t(&e_0);
                  }
                  if (v_88) {
                     _fx_free_LN14K_form__kexp_t(&v_88);
                  }
                  if (v_87) {
                     _fx_free_N14K_form__kexp_t(&v_87);
                  }
                  _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_86);
                  _fx_free_N14K_form__atom_t(&v_85);
                  _fx_free_N14K_form__klit_t(&v_84);
                  if (code__0) {
                     _fx_free_LN14K_form__kexp_t(&code__0);
                  }
                  if (checks__0) {
                     _fx_free_LN14K_form__kexp_t(&checks__0);
                  }
                  _fx_free_Ta2LN14K_form__kexp_t(&v_83);
                  _fx_free_Ta2LN14K_form__kexp_t(&v_82);
                  _fx_free_Ta3LR23K_normalize__pat_info_t(&plists__0);
                  _fx_free_Ta3LR23K_normalize__pat_info_t(&v_81);
                  _fx_free_R23K_normalize__pat_info_t(&pinfo_3);
                  if (v_80) {
                     _fx_free_N14K_form__kexp_t(&v_80);
                  }
                  _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_79);
                  _fx_free_N14K_form__atom_t(&v_78);
                  if (alt_cases_1) {
                     _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&alt_cases_1);
                  }
                  FX_CHECK_EXN(_fx_catch_17);
               }
               FX_COPY_PTR(__fold_result___2, &alt_cases_0);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypBool, &loc_0, &v_73);
               FX_CALL(
                  _fx_M6K_formFM9KExpMatchN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
                     alt_cases_0, &v_73, &v_74), _fx_catch_17);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(v_74, code_1, true, &v_75), _fx_catch_17);
               FX_CALL(
                  _fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_75, &loc_0, &alt_check_0, 0),
                  _fx_catch_17);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(alt_check_0, checks_0, true, &v_76), _fx_catch_17);
               _fx_make_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&plists_3, v_76, 0, &v_14);

            _fx_catch_17: ;
               if (v_76) {
                  _fx_free_LN14K_form__kexp_t(&v_76);
               }
               if (alt_check_0) {
                  _fx_free_N14K_form__kexp_t(&alt_check_0);
               }
               if (v_75) {
                  _fx_free_LN14K_form__kexp_t(&v_75);
               }
               if (v_74) {
                  _fx_free_N14K_form__kexp_t(&v_74);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_73);
               if (alt_cases_0) {
                  _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&alt_cases_0);
               }
               if (v_72) {
                  _fx_free_LN10Ast__pat_t(&v_72);
               }
               if (__fold_result___2) {
                  _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&__fold_result___2);
               }
               _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t(&v_71);
               if (v_70) {
                  _fx_free_N14K_form__kexp_t(&v_70);
               }
               _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_69);
               _fx_free_N14K_form__atom_t(&v_68);
               _fx_free_N14K_form__klit_t(&v_67);
               fx_free_exn(&v_66);
            }
            else {
               fx_exn_t v_91 = {0};
               fx_str_t slit_5 = FX_MAKE_STR("this type of pattern is not supported yet");
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &slit_5, &v_91, 0), _fx_catch_18);
               FX_THROW(&v_91, false, _fx_catch_18);

            _fx_catch_18: ;
               fx_free_exn(&v_91);
            }
            FX_CHECK_EXN(_fx_catch_19);
            _fx_copy_Ta3LR23K_normalize__pat_info_t(&v_14.t0, &plists_4);
            FX_COPY_PTR(v_14.t1, &checks_1);
            FX_COPY_PTR(v_14.t2, &code_2);
            _fx_make_Ta2LN14K_form__kexp_t(checks_1, code_2, &v_15);
            _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_1);
            _fx_copy_Ta3LR23K_normalize__pat_info_t(&plists_4, &plists_1);
            _fx_free_Ta2LN14K_form__kexp_t(&arg1_1);
            _fx_copy_Ta2LN14K_form__kexp_t(&v_15, &arg1_1);
            FX_FREE_LIST_SIMPLE(&case_sc_1);
            FX_COPY_PTR(case_sc_2, &case_sc_1);
         }

      _fx_catch_19: ;
         _fx_free_Ta2LN14K_form__kexp_t(&v_15);
         if (code_2) {
            _fx_free_LN14K_form__kexp_t(&code_2);
         }
         if (checks_1) {
            _fx_free_LN14K_form__kexp_t(&checks_1);
         }
         _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_4);
         _fx_free_T3Ta3LR23K_normalize__pat_info_tLN14K_form__kexp_tLN14K_form__kexp_t(&v_14);
         if (code_1) {
            _fx_free_LN14K_form__kexp_t(&code_1);
         }
         _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_13);
         _fx_free_Ta2LN14K_form__kexp_t(&v_12);
         if (p_1) {
            _fx_free_N10Ast__pat_t(&p_1);
         }
         _fx_free_T4N10Ast__pat_tR9Ast__id_tBB(&v_11);
         if (p_0) {
            _fx_free_N10Ast__pat_t(&p_0);
         }
         if (ptyp_0) {
            _fx_free_N14K_form__ktyp_t(&ptyp_0);
         }
         if (ke_0) {
            _fx_free_N14K_form__kexp_t(&ke_0);
         }
      }
      else {
         _fx_Ta2LN14K_form__kexp_t result_1 = {0};
         _fx_make_Ta2LN14K_form__kexp_t(checks_0, code_0, &result_1);
         _fx_free_Ta2LN14K_form__kexp_t(&result_0);
         _fx_copy_Ta2LN14K_form__kexp_t(&result_1, &result_0);
         FX_BREAK(_fx_catch_20);

      _fx_catch_20: ;
         _fx_free_Ta2LN14K_form__kexp_t(&result_1);
      }
      FX_CHECK_EXN(_fx_catch_21);

   _fx_catch_21: ;
      _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_3);
      _fx_free_Nt6option1R23K_normalize__pat_info_t(&p_opt_0);
      _fx_free_T2Nt6option1R23K_normalize__pat_info_tTa3LR23K_normalize__pat_info_t(&v_0);
      if (code_0) {
         _fx_free_LN14K_form__kexp_t(&code_0);
      }
      if (checks_0) {
         _fx_free_LN14K_form__kexp_t(&checks_0);
      }
      FX_FREE_LIST_SIMPLE(&case_sc_2);
      _fx_free_Ta2LN14K_form__kexp_t(&arg1_2);
      _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_2);
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_Ta2LN14K_form__kexp_t(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_Ta2LN14K_form__kexp_t(&result_0);
   _fx_free_Ta3LR23K_normalize__pat_info_t(&plists_1);
   _fx_free_Ta2LN14K_form__kexp_t(&arg1_1);
   FX_FREE_LIST_SIMPLE(&case_sc_1);
   return fx_status;
}

static int
   _fx_M11K_normalizeFM27get_var_tag_cmp_and_extractT5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t7R9Ast__id_tRM10pat_info_tTa2LN14K_form__kexp_tR9Ast__id_tLN12Ast__scope_tR10Ast__loc_ti(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R23K_normalize__pat_info_t* pinfo_0,
   struct _fx_Ta2LN14K_form__kexp_t* arg2_0,
   struct _fx_R9Ast__id_t* vn_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_R10Ast__loc_t* loc_0,
   int_ km_idx_0,
   struct _fx_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__kexp_t checks_0 = 0;
   _fx_LN14K_form__kexp_t code_0 = 0;
   _fx_N14K_form__ktyp_t pinfo_typ_0 = 0;
   _fx_N15K_form__kinfo_t v_0 = {0};
   _fx_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t v_1 = {0};
   _fx_LN14K_form__ktyp_t c_args_0 = 0;
   _fx_N14K_form__atom_t vn_tag_val_0 = {0};
   _fx_N14K_form__atom_t vn_case_val_0 = {0};
   _fx_T2R9Ast__id_tLN14K_form__kexp_t v_2 = {0};
   _fx_N14K_form__atom_t v_3 = {0};
   _fx_N14K_form__kexp_t extract_tag_exp_0 = 0;
   _fx_R16Ast__val_flags_t v_4 = {0};
   _fx_Nt6option1N14K_form__kexp_t v_5 = {0};
   _fx_LN14K_form__kexp_t code_1 = 0;
   _fx_LN14K_form__kexp_t code_2 = 0;
   _fx_N13Ast__binary_t v_6 = 0;
   _fx_N14K_form__atom_t v_7 = {0};
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_8 = {0};
   _fx_N14K_form__kexp_t cmp_tag_exp_0 = 0;
   _fx_LN14K_form__kexp_t v_9 = 0;
   _fx_N14K_form__kexp_t v_10 = 0;
   _fx_LN14K_form__kexp_t checks_1 = 0;
   _fx_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t v_11 = {0};
   _fx_LN14K_form__kexp_t code_3 = 0;
   _fx_Nt6option1N14K_form__kexp_t alt_e_opt_0 = {0};
   int fx_status = 0;
   FX_COPY_PTR(arg2_0->t0, &checks_0);
   FX_COPY_PTR(arg2_0->t1, &code_0);
   FX_COPY_PTR(pinfo_0->pinfo_typ, &pinfo_typ_0);
   _fx_R9Ast__id_t var_tag0_0 = pinfo_0->pinfo_tag;
   FX_CALL(_fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(vn_0, loc_0, &v_0, 0), _fx_cleanup);
   int tag_0 = v_0.tag;
   if (tag_0 == 3) {
      _fx_R17K_form__kdeffun_t v_12 = {0};
      _fx_LN14K_form__ktyp_t c_args_1 = 0;
      _fx_LR9Ast__id_t kf_params_0 = 0;
      _fx_N14K_form__atom_t vn_val_0 = {0};
      _fx_copy_R17K_form__kdeffun_t(&v_0.u.KFun->data, &v_12);
      _fx_LN14K_form__ktyp_t lstend_0 = 0;
      FX_COPY_PTR(v_12.kf_params, &kf_params_0);
      _fx_LR9Ast__id_t lst_0 = kf_params_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_R17K_form__kdefval_t v_13 = {0};
         _fx_R9Ast__id_t* arg_0 = &lst_0->hd;
         FX_CALL(_fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(arg_0, loc_0, &v_13, 0), _fx_catch_0);
         _fx_LN14K_form__ktyp_t node_0 = 0;
         FX_CALL(_fx_cons_LN14K_form__ktyp_t(v_13.kv_typ, 0, false, &node_0), _fx_catch_0);
         FX_LIST_APPEND(c_args_1, lstend_0, node_0);

      _fx_catch_0: ;
         _fx_free_R17K_form__kdefval_t(&v_13);
         FX_CHECK_EXN(_fx_catch_1);
      }
      _fx_N17Ast__fun_constr_t ctor_0 = v_12.kf_flags.fun_flag_ctor;
      if (ctor_0.tag == 3) {
         _fx_N14K_form__klit_t v_14 = {0};
         _fx_M6K_formFM7KLitIntN14K_form__klit_t1l((int64_t)ctor_0.u.CtorVariant, &v_14);
         _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_14, &vn_val_0);
         _fx_free_N14K_form__klit_t(&v_14);
      }
      else {
         _fx_N14K_form__klit_t v_15 = {0};
         _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(1LL, &v_15);
         _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_15, &vn_val_0);
         _fx_free_N14K_form__klit_t(&v_15);
      }
      FX_CHECK_EXN(_fx_catch_1);
      _fx_make_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t(c_args_1, &vn_val_0, &vn_val_0, &v_1);

   _fx_catch_1: ;
      _fx_free_N14K_form__atom_t(&vn_val_0);
      FX_FREE_LIST_SIMPLE(&kf_params_0);
      if (c_args_1) {
         _fx_free_LN14K_form__ktyp_t(&c_args_1);
      }
      _fx_free_R17K_form__kdeffun_t(&v_12);
   }
   else if (tag_0 == 4) {
      _fx_R17K_form__kdefexn_t v_16 = {0};
      _fx_LN14K_form__ktyp_t v_17 = 0;
      _fx_N14K_form__atom_t v_18 = {0};
      _fx_N14K_form__atom_t v_19 = {0};
      _fx_copy_R17K_form__kdefexn_t(&v_0.u.KExn->data, &v_16);
      _fx_N14K_form__ktyp_t ke_typ_0 = v_16.ke_typ;
      int tag_1 = FX_REC_VARIANT_TAG(ke_typ_0);
      if (tag_1 == 14) {
         FX_COPY_PTR(ke_typ_0->u.KTypTuple, &v_17);
      }
      else if (tag_1 != 7) {
         FX_CALL(_fx_cons_LN14K_form__ktyp_t(ke_typ_0, 0, true, &v_17), _fx_catch_2);  _fx_catch_2: ;
      }
      FX_CHECK_EXN(_fx_catch_3);
      _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&v_16.ke_tag, &v_18);
      _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(vn_0, &v_19);
      _fx_make_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t(v_17, &v_18, &v_19, &v_1);

   _fx_catch_3: ;
      _fx_free_N14K_form__atom_t(&v_19);
      _fx_free_N14K_form__atom_t(&v_18);
      if (v_17) {
         _fx_free_LN14K_form__ktyp_t(&v_17);
      }
      _fx_free_R17K_form__kdefexn_t(&v_16);
   }
   else if (tag_0 == 2) {
      _fx_N14K_form__klit_t v_20 = {0};
      _fx_N14K_form__atom_t vn_val_1 = {0};
      int_ ctor_id_0 = v_0.u.KVal.kv_flags.val_flag_ctor;
      _fx_M6K_formFM7KLitIntN14K_form__klit_t1l((int64_t)ctor_id_0, &v_20);
      _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_20, &vn_val_1);
      _fx_make_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t(0, &vn_val_1, &vn_val_1, &v_1);
      _fx_free_N14K_form__atom_t(&vn_val_1);
      _fx_free_N14K_form__klit_t(&v_20);
   }
   else {
      fx_str_t v_21 = {0};
      fx_str_t v_22 = {0};
      fx_exn_t v_23 = {0};
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(vn_0, &v_21, 0), _fx_catch_4);
      fx_str_t slit_0 = FX_MAKE_STR("a variant constructor (\'");
      fx_str_t slit_1 = FX_MAKE_STR("\') is expected here");
      {
         const fx_str_t strs_0[] = { slit_0, v_21, slit_1 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_22), _fx_catch_4);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_22, &v_23, 0), _fx_catch_4);
      FX_THROW(&v_23, false, _fx_catch_4);

   _fx_catch_4: ;
      fx_free_exn(&v_23);
      FX_FREE_STR(&v_22);
      FX_FREE_STR(&v_21);
   }
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_1.t0, &c_args_0);
   _fx_copy_N14K_form__atom_t(&v_1.t1, &vn_tag_val_0);
   _fx_copy_N14K_form__atom_t(&v_1.t2, &vn_case_val_0);
   bool res_0;
   FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&var_tag0_0, &_fx_g9Ast__noid, &res_0, 0), _fx_cleanup);
   if (!res_0) {
      _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&var_tag0_0, code_0, &v_2);
   }
   else {
      _fx_R9Ast__id_t tag_n_0;
      fx_str_t slit_2 = FX_MAKE_STR("tag");
      FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, &slit_2, &tag_n_0, 0), _fx_cleanup);
      _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_3);
      FX_CALL(
         _fx_M11K_normalizeFM19get_extract_tag_expN14K_form__kexp_t3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(&v_3,
            pinfo_typ_0, loc_0, &extract_tag_exp_0, 0), _fx_cleanup);
      FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_4, 0), _fx_cleanup);
      _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(extract_tag_exp_0, &v_5);
      FX_CALL(
         _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
            &tag_n_0, _fx_g21K_normalize__KTypCInt, &v_4, &v_5, code_0, loc_0, &code_1, 0), _fx_cleanup);
      _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&tag_n_0, code_1, &v_2);
   }
   _fx_R9Ast__id_t tag_n_1 = v_2.t0;
   FX_COPY_PTR(v_2.t1, &code_2);
   FX_CALL(_fx_M3AstFM5OpCmpN13Ast__binary_t1N12Ast__cmpop_t(&_fx_g18K_normalize__CmpEQ, &v_6), _fx_cleanup);
   _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&tag_n_1, &v_7);
   _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypBool, loc_0, &v_8);
   FX_CALL(
      _fx_M6K_formFM10KExpBinaryN14K_form__kexp_t4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
         v_6, &v_7, &vn_tag_val_0, &v_8, &cmp_tag_exp_0), _fx_cleanup);
   FX_CALL(_fx_cons_LN14K_form__kexp_t(cmp_tag_exp_0, code_2, true, &v_9), _fx_cleanup);
   FX_CALL(_fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_9, loc_0, &v_10, 0), _fx_cleanup);
   FX_CALL(_fx_cons_LN14K_form__kexp_t(v_10, checks_0, true, &checks_1), _fx_cleanup);
   if (c_args_0 == 0) {
      _fx_make_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(&_fx_g9Ast__noid, 0, &_fx_g19K_normalize__None3_,
         &v_11);
   }
   else {
      _fx_T2BN14K_form__ktyp_t v_24 = {0};
      _fx_N14K_form__ktyp_t case_typ_0 = 0;
      _fx_N14K_form__atom_t v_25 = {0};
      _fx_LN14K_form__atom_t v_26 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_27 = {0};
      _fx_N14K_form__kexp_t extract_case_exp_0 = 0;
      _fx_R16Ast__val_flags_t v_28 = {0};
      _fx_Nt6option1N14K_form__kexp_t v_29 = {0};
      _fx_LN14K_form__kexp_t code_4 = 0;
      _fx_Nt6option1N14K_form__kexp_t v_30 = {0};
      if (c_args_0 != 0) {
         if (c_args_0->tl == 0) {
            _fx_make_T2BN14K_form__ktyp_t(false, c_args_0->hd, &v_24); goto _fx_endmatch_0;
         }
      }
      _fx_N14K_form__ktyp_t v_31 = 0;
      FX_CALL(_fx_M6K_formFM9KTypTupleN14K_form__ktyp_t1LN14K_form__ktyp_t(c_args_0, &v_31), _fx_catch_5);
      _fx_make_T2BN14K_form__ktyp_t(true, v_31, &v_24);

   _fx_catch_5: ;
      if (v_31) {
         _fx_free_N14K_form__ktyp_t(&v_31);
      }

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_6);
      bool is_tuple_0 = v_24.t0;
      FX_COPY_PTR(v_24.t1, &case_typ_0);
      _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_25);
      FX_CALL(_fx_cons_LN14K_form__atom_t(&vn_case_val_0, 0, true, &v_26), _fx_catch_6);
      FX_CALL(_fx_cons_LN14K_form__atom_t(&v_25, v_26, false, &v_26), _fx_catch_6);
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(case_typ_0, loc_0, &v_27);
      FX_CALL(
         _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &_fx_g30K_normalize__IntrinVariantCase, v_26, &v_27, &extract_case_exp_0), _fx_catch_6);
      if (is_tuple_0) {
         _fx_R9Ast__id_t case_n_0;
         fx_str_t slit_3 = FX_MAKE_STR("vcase");
         FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, &slit_3, &case_n_0, 0), _fx_catch_6);
         FX_CALL(_fx_M3AstFM21default_tempref_flagsRM11val_flags_t0(&v_28, 0), _fx_catch_6);
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(extract_case_exp_0, &v_29);
         FX_CALL(
            _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
               &case_n_0, case_typ_0, &v_28, &v_29, 0, loc_0, &code_4, 0), _fx_catch_6);
         _fx_make_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(&case_n_0, code_4, &_fx_g19K_normalize__None3_,
            &v_11);
      }
      else {
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(extract_case_exp_0, &v_30);
         _fx_make_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(&_fx_g9Ast__noid, 0, &v_30, &v_11);
      }

   _fx_catch_6: ;
      _fx_free_Nt6option1N14K_form__kexp_t(&v_30);
      if (code_4) {
         _fx_free_LN14K_form__kexp_t(&code_4);
      }
      _fx_free_Nt6option1N14K_form__kexp_t(&v_29);
      _fx_free_R16Ast__val_flags_t(&v_28);
      if (extract_case_exp_0) {
         _fx_free_N14K_form__kexp_t(&extract_case_exp_0);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_27);
      if (v_26) {
         _fx_free_LN14K_form__atom_t(&v_26);
      }
      _fx_free_N14K_form__atom_t(&v_25);
      if (case_typ_0) {
         _fx_free_N14K_form__ktyp_t(&case_typ_0);
      }
      _fx_free_T2BN14K_form__ktyp_t(&v_24);
   }
   FX_CHECK_EXN(_fx_cleanup);
   _fx_R9Ast__id_t case_n_1 = v_11.t0;
   FX_COPY_PTR(v_11.t1, &code_3);
   _fx_copy_Nt6option1N14K_form__kexp_t(&v_11.t2, &alt_e_opt_0);
   _fx_make_T5R9Ast__id_tLN14K_form__ktyp_tLN14K_form__kexp_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(&case_n_1, c_args_0,
      checks_1, code_3, &alt_e_opt_0, fx_result);

_fx_cleanup: ;
   if (checks_0) {
      _fx_free_LN14K_form__kexp_t(&checks_0);
   }
   if (code_0) {
      _fx_free_LN14K_form__kexp_t(&code_0);
   }
   if (pinfo_typ_0) {
      _fx_free_N14K_form__ktyp_t(&pinfo_typ_0);
   }
   _fx_free_N15K_form__kinfo_t(&v_0);
   _fx_free_T3LN14K_form__ktyp_tN14K_form__atom_tN14K_form__atom_t(&v_1);
   if (c_args_0) {
      _fx_free_LN14K_form__ktyp_t(&c_args_0);
   }
   _fx_free_N14K_form__atom_t(&vn_tag_val_0);
   _fx_free_N14K_form__atom_t(&vn_case_val_0);
   _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_2);
   _fx_free_N14K_form__atom_t(&v_3);
   if (extract_tag_exp_0) {
      _fx_free_N14K_form__kexp_t(&extract_tag_exp_0);
   }
   _fx_free_R16Ast__val_flags_t(&v_4);
   _fx_free_Nt6option1N14K_form__kexp_t(&v_5);
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   if (code_2) {
      _fx_free_LN14K_form__kexp_t(&code_2);
   }
   if (v_6) {
      _fx_free_N13Ast__binary_t(&v_6);
   }
   _fx_free_N14K_form__atom_t(&v_7);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_8);
   if (cmp_tag_exp_0) {
      _fx_free_N14K_form__kexp_t(&cmp_tag_exp_0);
   }
   if (v_9) {
      _fx_free_LN14K_form__kexp_t(&v_9);
   }
   if (v_10) {
      _fx_free_N14K_form__kexp_t(&v_10);
   }
   if (checks_1) {
      _fx_free_LN14K_form__kexp_t(&checks_1);
   }
   _fx_free_T3R9Ast__id_tLN14K_form__kexp_tNt6option1N14K_form__kexp_t(&v_11);
   if (code_3) {
      _fx_free_LN14K_form__kexp_t(&code_3);
   }
   _fx_free_Nt6option1N14K_form__kexp_t(&alt_e_opt_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM13transform_funLN14K_form__kexp_t3rR13Ast__deffun_tLN14K_form__kexp_tLN12Ast__scope_t(
   struct _fx_rR13Ast__deffun_t_data_t* df_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_rLR9Ast__id_t df_templ_inst_0 = 0;
   _fx_LR9Ast__id_t df_templ_args_0 = 0;
   _fx_LR9Ast__id_t inst_list_0 = 0;
   _fx_LN14K_form__kexp_t __fold_result___0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int_ km_idx_0;
   FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &km_idx_0, 0), _fx_cleanup);
   _fx_R13Ast__deffun_t* v_0 = &df_0->data;
   _fx_R10Ast__loc_t df_loc_0 = v_0->df_loc;
   FX_COPY_PTR(v_0->df_templ_inst, &df_templ_inst_0);
   FX_COPY_PTR(v_0->df_templ_args, &df_templ_args_0);
   _fx_R9Ast__id_t df_name_0 = v_0->df_name;
   bool is_private_fun_0;
   bool res_0;
   if (sc_0 == 0) {
      res_0 = true; goto _fx_endmatch_0;
   }
   if (sc_0 != 0) {
      if (sc_0->hd.tag == 10) {
         res_0 = true; goto _fx_endmatch_0;
      }
   }
   res_0 = false;

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      is_private_fun_0 = false; goto _fx_endmatch_1;
   }
   is_private_fun_0 = true;

_fx_endmatch_1: ;
   FX_CHECK_EXN(_fx_cleanup);
   if (df_templ_args_0 == 0) {
      FX_CALL(_fx_cons_LR9Ast__id_t(&df_name_0, 0, true, &inst_list_0), _fx_cleanup);
   }
   else {
      FX_COPY_PTR(df_templ_inst_0->data, &inst_list_0);
   }
   FX_COPY_PTR(code_0, &__fold_result___0);
   _fx_LR9Ast__id_t lst_0 = inst_list_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN14K_form__kexp_t code_1 = 0;
      _fx_N14Ast__id_info_t v_1 = {0};
      _fx_LN14K_form__kexp_t v_2 = 0;
      _fx_R9Ast__id_t* inst_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &code_1);
      FX_CALL(_fx_M3AstFM7id_infoN14Ast__id_info_t2RM4id_tRM5loc_t(inst_0, &df_loc_0, &v_1, 0), _fx_catch_10);
      if (v_1.tag == 3) {
         _fx_N10Ast__exp_t inst_body_0 = 0;
         _fx_N10Ast__typ_t inst_typ_0 = 0;
         _fx_LN10Ast__pat_t inst_args_0 = 0;
         _fx_N14K_form__ktyp_t ktyp_0 = 0;
         _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t v_3 = {0};
         _fx_LN14K_form__ktyp_t argtyps_0 = 0;
         _fx_N14K_form__ktyp_t rt_0 = 0;
         _fx_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t v_4 = {0};
         _fx_LN10Ast__pat_t __fold_result___1 = 0;
         _fx_LN10Ast__pat_t v_5 = 0;
         _fx_LN14K_form__ktyp_t v_6 = 0;
         _fx_LN10Ast__pat_t inst_args_1 = 0;
         _fx_LN14K_form__ktyp_t argtyps_1 = 0;
         _fx_N10Ast__exp_t inst_body_1 = 0;
         fx_str_t v_7 = {0};
         fx_str_t v_8 = {0};
         fx_str_t v_9 = {0};
         fx_exn_t v_10 = {0};
         _fx_LN12Ast__scope_t body_sc_0 = 0;
         _fx_T2LR9Ast__id_tLN14K_form__kexp_t __fold_result___2 = {0};
         _fx_T2LR9Ast__id_tLN14K_form__kexp_t v_11 = {0};
         _fx_LR9Ast__id_t params_0 = 0;
         _fx_LN14K_form__kexp_t body_code_0 = 0;
         _fx_LR9Ast__id_t v_12 = 0;
         _fx_LN14K_form__kexp_t res_1 = 0;
         _fx_T2N14K_form__kexp_tLN14K_form__kexp_t v_13 = {0};
         _fx_N14K_form__kexp_t e_0 = 0;
         _fx_LN14K_form__kexp_t body_code_1 = 0;
         _fx_LN14K_form__kexp_t v_14 = 0;
         _fx_N14K_form__kexp_t body_kexp_0 = 0;
         _fx_LR9Ast__id_t v_15 = 0;
         _fx_Nt6option1N14K_form__kexp_t v_16 = {0};
         _fx_R13Ast__deffun_t* v_17 = &v_1.u.IdFun->data;
         _fx_R10Ast__loc_t inst_loc_0 = v_17->df_loc;
         _fx_R16Ast__fun_flags_t inst_flags_0 = v_17->df_flags;
         FX_COPY_PTR(v_17->df_body, &inst_body_0);
         FX_COPY_PTR(v_17->df_typ, &inst_typ_0);
         FX_COPY_PTR(v_17->df_args, &inst_args_0);
         _fx_R9Ast__id_t inst_name_0 = v_17->df_name;
         FX_CALL(_fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(inst_typ_0, &df_loc_0, &ktyp_0, 0),
            _fx_catch_8);
         if (FX_REC_VARIANT_TAG(ktyp_0) == 13) {
            _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* vcase_0 = &ktyp_0->u.KTypFun;
            _fx_make_T2LN14K_form__ktyp_tN14K_form__ktyp_t(vcase_0->t0, vcase_0->t1, &v_3);
         }
         else {
            fx_str_t v_18 = {0};
            fx_str_t v_19 = {0};
            fx_exn_t v_20 = {0};
            FX_CALL(_fx_M3AstFM6stringS1RM4id_t(&inst_name_0, &v_18, 0), _fx_catch_0);
            fx_str_t slit_0 = FX_MAKE_STR("the type of non-constructor function \'");
            fx_str_t slit_1 = FX_MAKE_STR("\' should be TypFun(_,_)");
            {
               const fx_str_t strs_0[] = { slit_0, v_18, slit_1 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_19), _fx_catch_0);
            }
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&inst_loc_0, &v_19, &v_20, 0), _fx_catch_0);
            FX_THROW(&v_20, false, _fx_catch_0);

         _fx_catch_0: ;
            fx_free_exn(&v_20);
            FX_FREE_STR(&v_19);
            FX_FREE_STR(&v_18);
         }
         FX_CHECK_EXN(_fx_catch_8);
         FX_COPY_PTR(v_3.t0, &argtyps_0);
         FX_COPY_PTR(v_3.t1, &rt_0);
         if (!inst_flags_0.fun_flag_have_keywords) {
            _fx_make_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t(inst_args_0, argtyps_0, inst_body_0, &v_4);
         }
         else {
            _fx_LN10Ast__pat_t lst_1 = inst_args_0;
            for (; lst_1; lst_1 = lst_1->tl) {
               _fx_LN10Ast__pat_t r_0 = 0;
               _fx_N10Ast__pat_t a_0 = lst_1->hd;
               FX_COPY_PTR(__fold_result___1, &r_0);
               FX_CALL(_fx_cons_LN10Ast__pat_t(a_0, r_0, false, &r_0), _fx_catch_1);
               _fx_free_LN10Ast__pat_t(&__fold_result___1);
               FX_COPY_PTR(r_0, &__fold_result___1);

            _fx_catch_1: ;
               if (r_0) {
                  _fx_free_LN10Ast__pat_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_8);
            }
            FX_COPY_PTR(__fold_result___1, &v_5);
            FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__ktyp_t1LN14K_form__ktyp_t(argtyps_0, &v_6, 0), _fx_catch_8);
            if (FX_REC_VARIANT_TAG(inst_body_0) == 12) {
               _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_1 = &inst_body_0->u.ExpSeq;
               _fx_LN10Ast__exp_t v_21 = vcase_1->t0;
               if (v_21 != 0) {
                  _fx_N10Ast__exp_t v_22 = v_21->hd;
                  if (FX_REC_VARIANT_TAG(v_22) == 34) {
                     _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* vcase_2 = &v_22->u.DefVal;
                     if (FX_REC_VARIANT_TAG(vcase_2->t1) == 7) {
                        _fx_N10Ast__pat_t v_23 = vcase_2->t0;
                        if (FX_REC_VARIANT_TAG(v_23) == 6) {
                           if (v_6 != 0) {
                              _fx_N14K_form__ktyp_t v_24 = v_6->hd;
                              if (FX_REC_VARIANT_TAG(v_24) == 15) {
                                 if (v_5 != 0) {
                                    fx_exn_t v_25 = {0};
                                    fx_exn_t v_26 = {0};
                                    _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t __fold_result___3 = {0};
                                    _fx_LT2R9Ast__id_tN14K_form__ktyp_t relems_0 = 0;
                                    _fx_LT2R9Ast__id_tN10Ast__pat_t relems_pats_0 = 0;
                                    _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t v_27 = {0};
                                    _fx_LN10Ast__pat_t inst_args_2 = 0;
                                    _fx_LN14K_form__ktyp_t argtyps_2 = 0;
                                    _fx_N10Ast__exp_t new_inst_body_0 = 0;
                                    _fx_LN10Ast__pat_t v_28 = 0;
                                    _fx_LN14K_form__ktyp_t v_29 = 0;
                                    _fx_LN10Ast__pat_t rest_inst_args_0 = v_5->tl;
                                    _fx_LT2R9Ast__id_tN14K_form__ktyp_t relems_1 = v_24->u.KTypRecord.t1;
                                    _fx_LN14K_form__ktyp_t rest_argtyps_0 = v_6->tl;
                                    _fx_LT2R9Ast__id_tN10Ast__pat_t relems_pats_1 = v_23->u.PatRecord.t1;
                                    _fx_R10Ast__loc_t* loc_0 = &vcase_2->t3;
                                    _fx_LN10Ast__exp_t rest_inst_body_0 = v_21->tl;
                                    int_ v_30 = _fx_M11K_normalizeFM6lengthi1LT2R9Ast__id_tN14K_form__ktyp_t(relems_1, 0);
                                    int_ v_31;
                                    FX_CALL(_fx_M11K_normalizeFM8length1_i1LT2R9Ast__id_tN10Ast__pat_t(relems_pats_1, &v_31, 0),
                                       _fx_catch_5);
                                    if (v_30 != v_31) {
                                       fx_str_t slit_2 =
                                          FX_MAKE_STR("the number of pattern elems in the unpack operation is incorrect");
                                       FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_2, &v_25, 0), _fx_catch_5);
                                       FX_THROW(&v_25, false, _fx_catch_5);
                                    }
                                    int_ v_32;
                                    FX_CALL(_fx_M11K_normalizeFM8length1_i1LN14K_form__ktyp_t(rest_argtyps_0, &v_32, 0),
                                       _fx_catch_5);
                                    int_ v_33;
                                    FX_CALL(_fx_M11K_normalizeFM8length1_i1LN10Ast__pat_t(rest_inst_args_0, &v_33, 0),
                                       _fx_catch_5);
                                    if (v_32 != v_33) {
                                       fx_str_t slit_3 =
                                          FX_MAKE_STR("the number of positional arguments and their types do not match");
                                       FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_3, &v_26, 0), _fx_catch_5);
                                       FX_THROW(&v_26, false, _fx_catch_5);
                                    }
                                    _fx_make_T2LN10Ast__pat_tLN14K_form__ktyp_t(rest_inst_args_0, rest_argtyps_0,
                                       &__fold_result___3);
                                    FX_COPY_PTR(relems_1, &relems_0);
                                    _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_2 = relems_0;
                                    FX_COPY_PTR(relems_pats_1, &relems_pats_0);
                                    _fx_LT2R9Ast__id_tN10Ast__pat_t lst_3 = relems_pats_0;
                                    for (; lst_2 && lst_3; lst_3 = lst_3->tl, lst_2 = lst_2->tl) {
                                       _fx_N14K_form__ktyp_t ti_0 = 0;
                                       _fx_N10Ast__pat_t pi_0 = 0;
                                       _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t v_34 = {0};
                                       _fx_LN10Ast__pat_t inst_args_3 = 0;
                                       _fx_LN14K_form__ktyp_t argtyps_3 = 0;
                                       fx_str_t v_35 = {0};
                                       fx_str_t v_36 = {0};
                                       fx_str_t v_37 = {0};
                                       fx_exn_t v_38 = {0};
                                       _fx_T2LN10Ast__pat_tLN14K_form__ktyp_t v_39 = {0};
                                       _fx_T2R9Ast__id_tN10Ast__pat_t* __pat___0 = &lst_3->hd;
                                       _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___1 = &lst_2->hd;
                                       _fx_R9Ast__id_t ni_0 = __pat___1->t0;
                                       FX_COPY_PTR(__pat___1->t1, &ti_0);
                                       _fx_R9Ast__id_t ni__0 = __pat___0->t0;
                                       FX_COPY_PTR(__pat___0->t1, &pi_0);
                                       _fx_copy_T2LN10Ast__pat_tLN14K_form__ktyp_t(&__fold_result___3, &v_34);
                                       FX_COPY_PTR(v_34.t0, &inst_args_3);
                                       FX_COPY_PTR(v_34.t1, &argtyps_3);
                                       bool res_2;
                                       FX_CALL(_fx_M11K_normalizeFM6__ne__B2R9Ast__id_tR9Ast__id_t(&ni_0, &ni__0, &res_2, 0),
                                          _fx_catch_2);
                                       if (res_2) {
                                          FX_CALL(_fx_M3AstFM6stringS1RM4id_t(&ni_0, &v_35, 0), _fx_catch_2);
                                          FX_CALL(_fx_M3AstFM6stringS1RM4id_t(&ni__0, &v_36, 0), _fx_catch_2);
                                          fx_str_t slit_4 = FX_MAKE_STR("the record field \'");
                                          fx_str_t slit_5 = FX_MAKE_STR("\' does not match the record pattern field \'");
                                          fx_str_t slit_6 = FX_MAKE_STR("\'");
                                          {
                                             const fx_str_t strs_1[] = { slit_4, v_35, slit_5, v_36, slit_6 };
                                             FX_CALL(fx_strjoin(0, 0, 0, strs_1, 5, &v_37), _fx_catch_2);
                                          }
                                          FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_37, &v_38, 0), _fx_catch_2);
                                          FX_THROW(&v_38, false, _fx_catch_2);
                                       }
                                       FX_CALL(_fx_cons_LN10Ast__pat_t(pi_0, inst_args_3, false, &inst_args_3), _fx_catch_2);
                                       FX_CALL(_fx_cons_LN14K_form__ktyp_t(ti_0, argtyps_3, false, &argtyps_3), _fx_catch_2);
                                       _fx_make_T2LN10Ast__pat_tLN14K_form__ktyp_t(inst_args_3, argtyps_3, &v_39);
                                       _fx_free_T2LN10Ast__pat_tLN14K_form__ktyp_t(&__fold_result___3);
                                       _fx_copy_T2LN10Ast__pat_tLN14K_form__ktyp_t(&v_39, &__fold_result___3);

                                    _fx_catch_2: ;
                                       _fx_free_T2LN10Ast__pat_tLN14K_form__ktyp_t(&v_39);
                                       fx_free_exn(&v_38);
                                       FX_FREE_STR(&v_37);
                                       FX_FREE_STR(&v_36);
                                       FX_FREE_STR(&v_35);
                                       if (argtyps_3) {
                                          _fx_free_LN14K_form__ktyp_t(&argtyps_3);
                                       }
                                       if (inst_args_3) {
                                          _fx_free_LN10Ast__pat_t(&inst_args_3);
                                       }
                                       _fx_free_T2LN10Ast__pat_tLN14K_form__ktyp_t(&v_34);
                                       if (pi_0) {
                                          _fx_free_N10Ast__pat_t(&pi_0);
                                       }
                                       if (ti_0) {
                                          _fx_free_N14K_form__ktyp_t(&ti_0);
                                       }
                                       FX_CHECK_EXN(_fx_catch_5);
                                    }
                                    int s_0 = !lst_2 + !lst_3;
                                    FX_CHECK_EQ_SIZE(s_0 == 0 || s_0 == 2, _fx_catch_5);
                                    _fx_copy_T2LN10Ast__pat_tLN14K_form__ktyp_t(&__fold_result___3, &v_27);
                                    FX_COPY_PTR(v_27.t0, &inst_args_2);
                                    FX_COPY_PTR(v_27.t1, &argtyps_2);
                                    if (rest_inst_body_0 == 0) {
                                       FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&df_loc_0, &new_inst_body_0),
                                          _fx_catch_3);

                                    _fx_catch_3: ;
                                       goto _fx_endmatch_2;
                                    }
                                    if (rest_inst_body_0 != 0) {
                                       if (rest_inst_body_0->tl == 0) {
                                          FX_COPY_PTR(rest_inst_body_0->hd, &new_inst_body_0); goto _fx_endmatch_2;
                                       }
                                    }
                                    FX_CALL(
                                       _fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(rest_inst_body_0,
                                          &vcase_1->t1, &new_inst_body_0), _fx_catch_4);

                                 _fx_catch_4: ;

                                 _fx_endmatch_2: ;
                                    FX_CHECK_EXN(_fx_catch_5);
                                    FX_CALL(_fx_M11K_normalizeFM3revLN10Ast__pat_t1LN10Ast__pat_t(inst_args_2, &v_28, 0),
                                       _fx_catch_5);
                                    FX_CALL(_fx_M11K_normalizeFM3revLN14K_form__ktyp_t1LN14K_form__ktyp_t(argtyps_2, &v_29, 0),
                                       _fx_catch_5);
                                    _fx_make_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t(v_28, v_29, new_inst_body_0, &v_4);

                                 _fx_catch_5: ;
                                    if (v_29) {
                                       _fx_free_LN14K_form__ktyp_t(&v_29);
                                    }
                                    if (v_28) {
                                       _fx_free_LN10Ast__pat_t(&v_28);
                                    }
                                    if (new_inst_body_0) {
                                       _fx_free_N10Ast__exp_t(&new_inst_body_0);
                                    }
                                    if (argtyps_2) {
                                       _fx_free_LN14K_form__ktyp_t(&argtyps_2);
                                    }
                                    if (inst_args_2) {
                                       _fx_free_LN10Ast__pat_t(&inst_args_2);
                                    }
                                    _fx_free_T2LN10Ast__pat_tLN14K_form__ktyp_t(&v_27);
                                    if (relems_pats_0) {
                                       _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&relems_pats_0);
                                    }
                                    if (relems_0) {
                                       _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&relems_0);
                                    }
                                    _fx_free_T2LN10Ast__pat_tLN14K_form__ktyp_t(&__fold_result___3);
                                    fx_free_exn(&v_26);
                                    fx_free_exn(&v_25);
                                    goto _fx_endmatch_3;
                                 }
                              }
                           }
                        }
                     }
                  }
               }
            }
            fx_exn_t v_40 = {0};
            fx_str_t slit_7 =
               FX_MAKE_STR(
                  "the function with keyword parameters must have the anonymous record as the last parameter and should start with the record unpacking");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&df_loc_0, &slit_7, &v_40, 0), _fx_catch_6);
            FX_THROW(&v_40, false, _fx_catch_6);

         _fx_catch_6: ;
            fx_free_exn(&v_40);

         _fx_endmatch_3: ;
            FX_CHECK_EXN(_fx_catch_8);
         }
         FX_COPY_PTR(v_4.t0, &inst_args_1);
         FX_COPY_PTR(v_4.t1, &argtyps_1);
         FX_COPY_PTR(v_4.t2, &inst_body_1);
         int_ nargs_0;
         FX_CALL(_fx_M11K_normalizeFM8length1_i1LN10Ast__pat_t(inst_args_1, &nargs_0, 0), _fx_catch_8);
         int_ nargtypes_0;
         FX_CALL(_fx_M11K_normalizeFM8length1_i1LN14K_form__ktyp_t(argtyps_1, &nargtypes_0, 0), _fx_catch_8);
         if (nargs_0 != nargtypes_0) {
            FX_CALL(_fx_F6stringS1i(nargs_0, &v_7, 0), _fx_catch_8);
            FX_CALL(_fx_F6stringS1i(nargtypes_0, &v_8, 0), _fx_catch_8);
            fx_str_t slit_8 = FX_MAKE_STR("the number of argument patterns (");
            fx_str_t slit_9 = FX_MAKE_STR(") and the number of argument types (");
            fx_str_t slit_10 = FX_MAKE_STR(") do not match");
            {
               const fx_str_t strs_2[] = { slit_8, v_7, slit_9, v_8, slit_10 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_2, 5, &v_9), _fx_catch_8);
            }
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&inst_loc_0, &v_9, &v_10, 0), _fx_catch_8);
            FX_THROW(&v_10, false, _fx_catch_8);
         }
         _fx_N12Ast__scope_t v_41;
         FX_CALL(_fx_M3AstFM15new_block_scopeN12Ast__scope_t1i(km_idx_0, &v_41, 0), _fx_catch_8);
         FX_CALL(_fx_cons_LN12Ast__scope_t(&v_41, sc_0, true, &body_sc_0), _fx_catch_8);
         _fx_make_T2LR9Ast__id_tLN14K_form__kexp_t(0, 0, &__fold_result___2);
         int_ idx_0 = 0;
         _fx_LN10Ast__pat_t lst_4 = inst_args_1;
         _fx_LN14K_form__ktyp_t lst_5 = argtyps_1;
         for (; lst_4 && lst_5; lst_5 = lst_5->tl, lst_4 = lst_4->tl, idx_0 += 1) {
            _fx_T2LR9Ast__id_tLN14K_form__kexp_t v_42 = {0};
            _fx_LR9Ast__id_t params_1 = 0;
            _fx_LN14K_form__kexp_t body_code_2 = 0;
            fx_str_t v_43 = {0};
            fx_str_t arg_defname_0 = {0};
            _fx_R16Ast__val_flags_t v_44 = {0};
            _fx_T2R9Ast__id_tLN14K_form__kexp_t v_45 = {0};
            _fx_LN14K_form__kexp_t body_code_3 = 0;
            _fx_R16Ast__val_flags_t v_46 = {0};
            _fx_LN14K_form__kexp_t res_3 = 0;
            _fx_T2LR9Ast__id_tLN14K_form__kexp_t v_47 = {0};
            _fx_N14K_form__ktyp_t ti_1 = lst_5->hd;
            _fx_N10Ast__pat_t pi_1 = lst_4->hd;
            _fx_copy_T2LR9Ast__id_tLN14K_form__kexp_t(&__fold_result___2, &v_42);
            FX_COPY_PTR(v_42.t0, &params_1);
            FX_COPY_PTR(v_42.t1, &body_code_2);
            FX_CALL(_fx_F6stringS1i(idx_0, &v_43, 0), _fx_catch_7);
            fx_str_t slit_11 = FX_MAKE_STR("arg");
            {
               const fx_str_t strs_3[] = { slit_11, v_43 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_3, 2, &arg_defname_0), _fx_catch_7);
            }
            FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_44, 0), _fx_catch_7);
            FX_CALL(
               _fx_M11K_normalizeFM17pat_simple_unpackT2R9Ast__id_tLN14K_form__kexp_t7N10Ast__pat_tN14K_form__ktyp_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tSR16Ast__val_flags_tLN12Ast__scope_t(
                  pi_1, ti_1, &_fx_g19K_normalize__None3_, body_code_2, &arg_defname_0, &v_44, body_sc_0, &v_45, 0),
               _fx_catch_7);
            _fx_R9Ast__id_t i_0 = v_45.t0;
            FX_COPY_PTR(v_45.t1, &body_code_3);
            _fx_R9Ast__id_t i_1;
            if (i_0.m == 0) {
               FX_CALL(_fx_M6K_formFM7dup_idkR9Ast__id_t2iR9Ast__id_t(km_idx_0, &i_0, &i_1, 0), _fx_catch_7);
            }
            else {
               i_1 = i_0;
            }
            FX_CALL(_fx_M3AstFM17default_arg_flagsRM11val_flags_t0(&v_46, 0), _fx_catch_7);
            FX_CALL(
               _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
                  &i_1, ti_1, &v_46, &_fx_g19K_normalize__None3_, 0, &inst_loc_0, &res_3, 0), _fx_catch_7);
            FX_CALL(_fx_cons_LR9Ast__id_t(&i_1, params_1, false, &params_1), _fx_catch_7);
            _fx_make_T2LR9Ast__id_tLN14K_form__kexp_t(params_1, body_code_3, &v_47);
            _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&__fold_result___2);
            _fx_copy_T2LR9Ast__id_tLN14K_form__kexp_t(&v_47, &__fold_result___2);

         _fx_catch_7: ;
            _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&v_47);
            if (res_3) {
               _fx_free_LN14K_form__kexp_t(&res_3);
            }
            _fx_free_R16Ast__val_flags_t(&v_46);
            if (body_code_3) {
               _fx_free_LN14K_form__kexp_t(&body_code_3);
            }
            _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_45);
            _fx_free_R16Ast__val_flags_t(&v_44);
            FX_FREE_STR(&arg_defname_0);
            FX_FREE_STR(&v_43);
            if (body_code_2) {
               _fx_free_LN14K_form__kexp_t(&body_code_2);
            }
            FX_FREE_LIST_SIMPLE(&params_1);
            _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&v_42);
            FX_CHECK_EXN(_fx_catch_8);
         }
         int s_1 = !lst_4 + !lst_5;
         FX_CHECK_EQ_SIZE(s_1 == 0 || s_1 == 2, _fx_catch_8);
         _fx_copy_T2LR9Ast__id_tLN14K_form__kexp_t(&__fold_result___2, &v_11);
         FX_COPY_PTR(v_11.t0, &params_0);
         FX_COPY_PTR(v_11.t1, &body_code_0);
         int tag_0 = FX_REC_VARIANT_TAG(inst_body_1);
         bool is_cfunc_0;
         bool res_4;
         if (tag_0 == 32) {
            res_4 = true; goto _fx_endmatch_4;
         }
         if (tag_0 == 12) {
            _fx_LN10Ast__exp_t v_48 = inst_body_1->u.ExpSeq.t0;
            if (v_48 != 0) {
               _fx_LN10Ast__exp_t v_49 = v_48->tl;
               if (v_49 != 0) {
                  if (v_49->tl == 0) {
                     if (FX_REC_VARIANT_TAG(v_49->hd) == 32) {
                        res_4 = true; goto _fx_endmatch_4;
                     }
                  }
               }
            }
         }
         res_4 = false;

      _fx_endmatch_4: ;
         FX_CHECK_EXN(_fx_catch_8);
         if (res_4) {
            is_cfunc_0 = true; goto _fx_endmatch_5;
         }
         is_cfunc_0 = false;

      _fx_endmatch_5: ;
         FX_CHECK_EXN(_fx_catch_8);
         bool t_0;
         if (inst_flags_0.fun_flag_nothrow) {
            t_0 = is_cfunc_0;
         }
         else {
            t_0 = false;
         }
         _fx_R16Ast__fun_flags_t inst_flags_1 =
            { inst_flags_0.fun_flag_pure, is_cfunc_0, inst_flags_0.fun_flag_have_keywords, inst_flags_0.fun_flag_inline, t_0,
               inst_flags_0.fun_flag_really_nothrow, is_private_fun_0, inst_flags_0.fun_flag_ctor,
               inst_flags_0.fun_flag_method_of, inst_flags_0.fun_flag_uses_fv, inst_flags_0.fun_flag_recursive,
               inst_flags_0.fun_flag_instance };
         FX_CALL(_fx_M11K_normalizeFM3revLR9Ast__id_t1LR9Ast__id_t(params_0, &v_12, 0), _fx_catch_8);
         FX_CALL(
            _fx_M6K_formFM14create_kdeffunLN14K_form__kexp_t8R9Ast__id_tLR9Ast__id_tN14K_form__ktyp_tR16Ast__fun_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_t(
               &inst_name_0, v_12, rt_0, &inst_flags_1, &_fx_g19K_normalize__None3_, code_1, sc_0, &inst_loc_0, &res_1, 0),
            _fx_catch_8);
         _fx_R10Ast__loc_t body_loc_0;
         FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(inst_body_1, &body_loc_0, 0), _fx_catch_8);
         FX_CALL(
            _fx_M11K_normalizeFM8exp2kexpT2N14K_form__kexp_tLN14K_form__kexp_t4N10Ast__exp_tLN14K_form__kexp_tBLN12Ast__scope_t(
               inst_body_1, body_code_0, false, body_sc_0, &v_13, 0), _fx_catch_8);
         FX_COPY_PTR(v_13.t0, &e_0);
         FX_COPY_PTR(v_13.t1, &body_code_1);
         FX_CALL(_fx_cons_LN14K_form__kexp_t(e_0, body_code_1, true, &v_14), _fx_catch_8);
         FX_CALL(
            _fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(v_14, &body_loc_0, &body_kexp_0, 0),
            _fx_catch_8);
         FX_CALL(_fx_M11K_normalizeFM3revLR9Ast__id_t1LR9Ast__id_t(params_0, &v_15, 0), _fx_catch_8);
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(body_kexp_0, &v_16);
         FX_CALL(
            _fx_M6K_formFM14create_kdeffunLN14K_form__kexp_t8R9Ast__id_tLR9Ast__id_tN14K_form__ktyp_tR16Ast__fun_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_t(
               &inst_name_0, v_15, rt_0, &inst_flags_1, &v_16, code_1, sc_0, &inst_loc_0, &v_2, 0), _fx_catch_8);

      _fx_catch_8: ;
         _fx_free_Nt6option1N14K_form__kexp_t(&v_16);
         FX_FREE_LIST_SIMPLE(&v_15);
         if (body_kexp_0) {
            _fx_free_N14K_form__kexp_t(&body_kexp_0);
         }
         if (v_14) {
            _fx_free_LN14K_form__kexp_t(&v_14);
         }
         if (body_code_1) {
            _fx_free_LN14K_form__kexp_t(&body_code_1);
         }
         if (e_0) {
            _fx_free_N14K_form__kexp_t(&e_0);
         }
         _fx_free_T2N14K_form__kexp_tLN14K_form__kexp_t(&v_13);
         if (res_1) {
            _fx_free_LN14K_form__kexp_t(&res_1);
         }
         FX_FREE_LIST_SIMPLE(&v_12);
         if (body_code_0) {
            _fx_free_LN14K_form__kexp_t(&body_code_0);
         }
         FX_FREE_LIST_SIMPLE(&params_0);
         _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&v_11);
         _fx_free_T2LR9Ast__id_tLN14K_form__kexp_t(&__fold_result___2);
         FX_FREE_LIST_SIMPLE(&body_sc_0);
         fx_free_exn(&v_10);
         FX_FREE_STR(&v_9);
         FX_FREE_STR(&v_8);
         FX_FREE_STR(&v_7);
         if (inst_body_1) {
            _fx_free_N10Ast__exp_t(&inst_body_1);
         }
         if (argtyps_1) {
            _fx_free_LN14K_form__ktyp_t(&argtyps_1);
         }
         if (inst_args_1) {
            _fx_free_LN10Ast__pat_t(&inst_args_1);
         }
         if (v_6) {
            _fx_free_LN14K_form__ktyp_t(&v_6);
         }
         if (v_5) {
            _fx_free_LN10Ast__pat_t(&v_5);
         }
         if (__fold_result___1) {
            _fx_free_LN10Ast__pat_t(&__fold_result___1);
         }
         _fx_free_T3LN10Ast__pat_tLN14K_form__ktyp_tN10Ast__exp_t(&v_4);
         if (rt_0) {
            _fx_free_N14K_form__ktyp_t(&rt_0);
         }
         if (argtyps_0) {
            _fx_free_LN14K_form__ktyp_t(&argtyps_0);
         }
         _fx_free_T2LN14K_form__ktyp_tN14K_form__ktyp_t(&v_3);
         if (ktyp_0) {
            _fx_free_N14K_form__ktyp_t(&ktyp_0);
         }
         if (inst_args_0) {
            _fx_free_LN10Ast__pat_t(&inst_args_0);
         }
         if (inst_typ_0) {
            _fx_free_N10Ast__typ_t(&inst_typ_0);
         }
         if (inst_body_0) {
            _fx_free_N10Ast__exp_t(&inst_body_0);
         }
      }
      else {
         fx_str_t v_50 = {0};
         fx_str_t v_51 = {0};
         fx_str_t v_52 = {0};
         fx_exn_t v_53 = {0};
         _fx_R10Ast__loc_t v_54;
         FX_CALL(_fx_M3AstFM14get_idinfo_locRM5loc_t1N14Ast__id_info_t(&v_1, &v_54, 0), _fx_catch_9);
         FX_CALL(_fx_M3AstFM6stringS1RM4id_t(inst_0, &v_50, 0), _fx_catch_9);
         FX_CALL(_fx_M3AstFM6stringS1RM4id_t(&df_name_0, &v_51, 0), _fx_catch_9);
         fx_str_t slit_12 = FX_MAKE_STR("the entry \'");
         fx_str_t slit_13 = FX_MAKE_STR("\' (an instance of \'");
         fx_str_t slit_14 = FX_MAKE_STR("\'?) is supposed to be a function, but it\'s not");
         {
            const fx_str_t strs_4[] = { slit_12, v_50, slit_13, v_51, slit_14 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_4, 5, &v_52), _fx_catch_9);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&v_54, &v_52, &v_53, 0), _fx_catch_9);
         FX_THROW(&v_53, false, _fx_catch_9);

      _fx_catch_9: ;
         fx_free_exn(&v_53);
         FX_FREE_STR(&v_52);
         FX_FREE_STR(&v_51);
         FX_FREE_STR(&v_50);
      }
      FX_CHECK_EXN(_fx_catch_10);
      _fx_free_LN14K_form__kexp_t(&__fold_result___0);
      FX_COPY_PTR(v_2, &__fold_result___0);

   _fx_catch_10: ;
      if (v_2) {
         _fx_free_LN14K_form__kexp_t(&v_2);
      }
      _fx_free_N14Ast__id_info_t(&v_1);
      if (code_1) {
         _fx_free_LN14K_form__kexp_t(&code_1);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (df_templ_inst_0) {
      _fx_free_rLR9Ast__id_t(&df_templ_inst_0);
   }
   FX_FREE_LIST_SIMPLE(&df_templ_args_0);
   FX_FREE_LIST_SIMPLE(&inst_list_0);
   if (__fold_result___0) {
      _fx_free_LN14K_form__kexp_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M11K_normalizeFM28transform_all_types_and_consLN14K_form__kexp_t3LN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
   struct _fx_LN10Ast__exp_t_data_t* elist_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__kexp_t __fold_result___0 = 0;
   int fx_status = 0;
   int_ km_idx_0;
   FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &km_idx_0, 0), _fx_cleanup);
   FX_COPY_PTR(code_0, &__fold_result___0);
   _fx_LN10Ast__exp_t lst_0 = elist_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN14K_form__kexp_t code_1 = 0;
      _fx_LN14K_form__kexp_t v_0 = 0;
      _fx_N10Ast__exp_t e_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &code_1);
      int tag_0 = FX_REC_VARIANT_TAG(e_0);
      if (tag_0 == 38) {
         _fx_R17Ast__defvariant_t v_1 = {0};
         _fx_LR9Ast__id_t inst_list_0 = 0;
         _fx_LR9Ast__id_t tags_0 = 0;
         _fx_LT2R9Ast__id_tN10Ast__typ_t dvar_cases_0 = 0;
         _fx_LN14K_form__kexp_t __fold_result___1 = 0;
         _fx_copy_R17Ast__defvariant_t(&e_0->u.DefVariant->data, &v_1);
         _fx_R10Ast__loc_t* dvar_loc_0 = &v_1.dvar_loc;
         _fx_R9Ast__id_t* dvar_name_0 = &v_1.dvar_name;
         if (v_1.dvar_templ_args == 0) {
            FX_CALL(_fx_cons_LR9Ast__id_t(dvar_name_0, 0, true, &inst_list_0), _fx_catch_21);
         }
         else {
            FX_COPY_PTR(v_1.dvar_templ_inst->data, &inst_list_0);
         }
         _fx_LR9Ast__id_t lstend_0 = 0;
         int_ i_0 = 0;
         FX_COPY_PTR(v_1.dvar_cases, &dvar_cases_0);
         _fx_LT2R9Ast__id_tN10Ast__typ_t lst_1 = dvar_cases_0;
         for (; lst_1; lst_1 = lst_1->tl, i_0 += 1) {
            _fx_R16Ast__val_flags_t v_2 = {0};
            _fx_R16Ast__val_flags_t tag_flags_0 = {0};
            _fx_N14K_form__klit_t v_3 = {0};
            _fx_N14K_form__atom_t v_4 = {0};
            _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_5 = {0};
            _fx_N14K_form__kexp_t v_6 = 0;
            _fx_Nt6option1N14K_form__kexp_t v_7 = {0};
            _fx_LN14K_form__kexp_t res_0 = 0;
            _fx_T2R9Ast__id_tN10Ast__typ_t* __pat___0 = &lst_1->hd;
            _fx_R9Ast__id_t n_0 = __pat___0->t0;
            bool res_1;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&n_0, &_fx_g9Ast__noid, &res_1, 0), _fx_catch_0);
            _fx_R9Ast__id_t t_0;
            if (res_1) {
               t_0 = _fx_g9Ast__noid;
            }
            else {
               _fx_R9Ast__id_t tag_id_0;
               FX_CALL(_fx_M6K_formFM7dup_idkR9Ast__id_t2iR9Ast__id_t(km_idx_0, &n_0, &tag_id_0, 0), _fx_catch_0);
               FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_2, 0), _fx_catch_0);
               _fx_make_R16Ast__val_flags_t(v_2.val_flag_arg, v_2.val_flag_mutable, v_2.val_flag_temp, v_2.val_flag_tempref,
                  v_2.val_flag_private, v_2.val_flag_subarray, v_2.val_flag_instance, &v_2.val_flag_method, v_2.val_flag_ctor,
                  v_1.dvar_scope, &tag_flags_0);
               int64_t res_2;
               FX_CALL(_fx_M11K_normalizeFM5int64l1i(i_0 + 1, &res_2, 0), _fx_catch_0);
               _fx_M6K_formFM8KLitSIntN14K_form__klit_t2il(32, res_2, &v_3);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_3, &v_4);
               _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypCInt, dvar_loc_0, &v_5);
               FX_CALL(
                  _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_4, &v_5, &v_6),
                  _fx_catch_0);
               _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(v_6, &v_7);
               FX_CALL(
                  _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
                     &tag_id_0, _fx_g21K_normalize__KTypCInt, &tag_flags_0, &v_7, 0, dvar_loc_0, &res_0, 0), _fx_catch_0);
               t_0 = tag_id_0;
            }
            _fx_LR9Ast__id_t node_0 = 0;
            FX_CALL(_fx_cons_LR9Ast__id_t(&t_0, 0, false, &node_0), _fx_catch_0);
            FX_LIST_APPEND(tags_0, lstend_0, node_0);

         _fx_catch_0: ;
            if (res_0) {
               _fx_free_LN14K_form__kexp_t(&res_0);
            }
            _fx_free_Nt6option1N14K_form__kexp_t(&v_7);
            if (v_6) {
               _fx_free_N14K_form__kexp_t(&v_6);
            }
            _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_5);
            _fx_free_N14K_form__atom_t(&v_4);
            _fx_free_N14K_form__klit_t(&v_3);
            _fx_free_R16Ast__val_flags_t(&tag_flags_0);
            _fx_free_R16Ast__val_flags_t(&v_2);
            FX_CHECK_EXN(_fx_catch_21);
         }
         FX_COPY_PTR(code_1, &__fold_result___1);
         _fx_LR9Ast__id_t lst_2 = inst_list_0;
         for (; lst_2; lst_2 = lst_2->tl) {
            _fx_LN14K_form__kexp_t code_2 = 0;
            _fx_N14Ast__id_info_t v_8 = {0};
            _fx_LN14K_form__kexp_t v_9 = 0;
            _fx_R9Ast__id_t* inst_0 = &lst_2->hd;
            FX_COPY_PTR(__fold_result___1, &code_2);
            FX_CALL(_fx_M3AstFM7id_infoN14Ast__id_info_t2RM4id_tRM5loc_t(inst_0, dvar_loc_0, &v_8, 0), _fx_catch_20);
            if (v_8.tag == 6) {
               _fx_R17Ast__defvariant_t v_10 = {0};
               _fx_N10Ast__typ_t v_11 = 0;
               _fx_LN14K_form__ktyp_t targs_0 = 0;
               _fx_copy_R17Ast__defvariant_t(&v_8.u.IdVariant->data, &v_10);
               _fx_R10Ast__loc_t* inst_loc_0 = &v_10.dvar_loc;
               _fx_R16Ast__var_flags_t* dvar_flags_0 = &v_10.dvar_flags;
               _fx_LT2R9Ast__id_tLTa2R9Ast__id_t dvar_ifaces_0 = v_10.dvar_ifaces;
               _fx_LR9Ast__id_t dvar_ctors_0 = v_10.dvar_ctors;
               _fx_LT2R9Ast__id_tN10Ast__typ_t dvar_cases_1 = v_10.dvar_cases;
               _fx_R9Ast__id_t* inst_name_0 = &v_10.dvar_name;
               FX_CALL(_fx_M3AstFM9deref_typN10Ast__typ_t1N10Ast__typ_t(v_10.dvar_alias, &v_11, 0), _fx_catch_18);
               if (FX_REC_VARIANT_TAG(v_11) == 24) {
                  _fx_LN10Ast__typ_t targs_1 = 0;
                  _fx_LN14K_form__ktyp_t lstend_1 = 0;
                  FX_COPY_PTR(v_11->u.TypApp.t0, &targs_1);
                  _fx_LN10Ast__typ_t lst_3 = targs_1;
                  for (; lst_3; lst_3 = lst_3->tl) {
                     _fx_N14K_form__ktyp_t res_3 = 0;
                     _fx_N10Ast__typ_t t_1 = lst_3->hd;
                     FX_CALL(
                        _fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(t_1, inst_loc_0, &res_3, 0),
                        _fx_catch_1);
                     _fx_LN14K_form__ktyp_t node_1 = 0;
                     FX_CALL(_fx_cons_LN14K_form__ktyp_t(res_3, 0, false, &node_1), _fx_catch_1);
                     FX_LIST_APPEND(targs_0, lstend_1, node_1);

                  _fx_catch_1: ;
                     if (res_3) {
                        _fx_free_N14K_form__ktyp_t(&res_3);
                     }
                     FX_CHECK_EXN(_fx_catch_2);
                  }

               _fx_catch_2: ;
                  if (targs_1) {
                     _fx_free_LN10Ast__typ_t(&targs_1);
                  }
               }
               else {
                  fx_str_t v_12 = {0};
                  fx_str_t v_13 = {0};
                  fx_exn_t v_14 = {0};
                  FX_CALL(_fx_M3AstFM6stringS1RM4id_t(inst_name_0, &v_12, 0), _fx_catch_3);
                  fx_str_t slit_0 = FX_MAKE_STR("invalid variant type alias \'");
                  fx_str_t slit_1 = FX_MAKE_STR("\'; should be TypApp(_, _)");
                  {
                     const fx_str_t strs_0[] = { slit_0, v_12, slit_1 };
                     FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_13), _fx_catch_3);
                  }
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(inst_loc_0, &v_13, &v_14, 0), _fx_catch_3);
                  FX_THROW(&v_14, false, _fx_catch_3);

               _fx_catch_3: ;
                  fx_free_exn(&v_14);
                  FX_FREE_STR(&v_13);
                  FX_FREE_STR(&v_12);
               }
               FX_CHECK_EXN(_fx_catch_18);
               if (dvar_ifaces_0 == 0) {
                  if (dvar_flags_0->var_flag_record == true) {
                     if (dvar_cases_1 != 0) {
                        if (dvar_cases_1->tl == 0) {
                           _fx_N10Ast__typ_t v_15 = dvar_cases_1->hd.t1;
                           if (FX_REC_VARIANT_TAG(v_15) == 20) {
                              _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_16 = {0};
                              _fx_LT2R9Ast__id_tN14K_form__ktyp_t rec_elems_0 = 0;
                              _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_0 = 0;
                              _fx_N14K_form__ktyp_t v_17 = 0;
                              _fx_R17K_form__kdeftyp_t v_18 = {0};
                              _fx_rR17K_form__kdeftyp_t kt_0 = 0;
                              _fx_N15K_form__kinfo_t v_19 = {0};
                              _fx_N14K_form__kexp_t v_20 = 0;
                              _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_15->u.TypRecord->data,
                                 &v_16);
                              _fx_LT2R9Ast__id_tN14K_form__ktyp_t lstend_2 = 0;
                              FX_COPY_PTR(v_16.t0, &relems_0);
                              _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_4 = relems_0;
                              for (; lst_4; lst_4 = lst_4->tl) {
                                 _fx_N10Ast__typ_t t_2 = 0;
                                 _fx_N14K_form__ktyp_t v_21 = 0;
                                 _fx_T2R9Ast__id_tN14K_form__ktyp_t tup_0 = {0};
                                 _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* __pat___1 = &lst_4->hd;
                                 _fx_R9Ast__id_t i_1 = __pat___1->t1;
                                 FX_COPY_PTR(__pat___1->t2, &t_2);
                                 FX_CALL(
                                    _fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(t_2, inst_loc_0,
                                       &v_21, 0), _fx_catch_4);
                                 _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(&i_1, v_21, &tup_0);
                                 _fx_LT2R9Ast__id_tN14K_form__ktyp_t node_2 = 0;
                                 FX_CALL(_fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(&tup_0, 0, false, &node_2), _fx_catch_4);
                                 FX_LIST_APPEND(rec_elems_0, lstend_2, node_2);

                              _fx_catch_4: ;
                                 _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&tup_0);
                                 if (v_21) {
                                    _fx_free_N14K_form__ktyp_t(&v_21);
                                 }
                                 if (t_2) {
                                    _fx_free_N10Ast__typ_t(&t_2);
                                 }
                                 FX_CHECK_EXN(_fx_catch_5);
                              }
                              FX_CALL(
                                 _fx_M6K_formFM10KTypRecordN14K_form__ktyp_t2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(
                                    inst_name_0, rec_elems_0, &v_17), _fx_catch_5);
                              fx_str_t slit_2 = FX_MAKE_STR("");
                              _fx_make_R17K_form__kdeftyp_t(inst_name_0, &slit_2, &_fx_g9Ast__noid, &_fx_g19K_normalize__None4_,
                                 targs_0, v_17, sc_0, inst_loc_0, &v_18);
                              FX_CALL(_fx_make_rR17K_form__kdeftyp_t(&v_18, &kt_0), _fx_catch_5);
                              _fx_M6K_formFM4KTypN15K_form__kinfo_t1rRM9kdeftyp_t(kt_0, &v_19);
                              FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(inst_name_0, &v_19, 0),
                                 _fx_catch_5);
                              FX_CALL(_fx_M6K_formFM7KDefTypN14K_form__kexp_t1rRM9kdeftyp_t(kt_0, &v_20), _fx_catch_5);
                              FX_CALL(_fx_cons_LN14K_form__kexp_t(v_20, code_2, true, &v_9), _fx_catch_5);

                           _fx_catch_5: ;
                              if (v_20) {
                                 _fx_free_N14K_form__kexp_t(&v_20);
                              }
                              _fx_free_N15K_form__kinfo_t(&v_19);
                              if (kt_0) {
                                 _fx_free_rR17K_form__kdeftyp_t(&kt_0);
                              }
                              _fx_free_R17K_form__kdeftyp_t(&v_18);
                              if (v_17) {
                                 _fx_free_N14K_form__ktyp_t(&v_17);
                              }
                              if (relems_0) {
                                 _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_0);
                              }
                              if (rec_elems_0) {
                                 _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&rec_elems_0);
                              }
                              _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_16);
                              goto _fx_endmatch_1;
                           }
                        }
                     }
                  }
               }
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_0 = 0;
               _fx_LT2R9Ast__id_tN10Ast__typ_t dvar_cases_2 = 0;
               _fx_LT2R9Ast__id_tLR9Ast__id_t kvar_ifaces_0 = 0;
               _fx_LT2R9Ast__id_tLTa2R9Ast__id_t dvar_ifaces_1 = 0;
               _fx_R21K_form__kdefvariant_t v_22 = {0};
               _fx_rR21K_form__kdefvariant_t kvar_0 = 0;
               _fx_N15K_form__kinfo_t v_23 = {0};
               _fx_N14K_form__kexp_t v_24 = 0;
               _fx_LN14K_form__kexp_t code_3 = 0;
               _fx_N14K_form__ktyp_t new_rt_0 = 0;
               _fx_LN14K_form__kexp_t __fold_result___2 = 0;
               _fx_LR9Ast__id_t dvar_ctors_1 = 0;
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t lstend_3 = 0;
               FX_COPY_PTR(dvar_cases_1, &dvar_cases_2);
               _fx_LT2R9Ast__id_tN10Ast__typ_t lst_5 = dvar_cases_2;
               _fx_LR9Ast__id_t lst_6 = tags_0;
               for (; lst_5 && lst_6; lst_6 = lst_6->tl, lst_5 = lst_5->tl) {
                  _fx_N10Ast__typ_t t_3 = 0;
                  _fx_N14K_form__ktyp_t v_25 = 0;
                  _fx_T2R9Ast__id_tN14K_form__ktyp_t tup_1 = {0};
                  _fx_R9Ast__id_t* tag_1 = &lst_6->hd;
                  _fx_T2R9Ast__id_tN10Ast__typ_t* __pat___2 = &lst_5->hd;
                  FX_COPY_PTR(__pat___2->t1, &t_3);
                  FX_CALL(_fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(t_3, inst_loc_0, &v_25, 0),
                     _fx_catch_6);
                  _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(tag_1, v_25, &tup_1);
                  _fx_LT2R9Ast__id_tN14K_form__ktyp_t node_3 = 0;
                  FX_CALL(_fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(&tup_1, 0, false, &node_3), _fx_catch_6);
                  FX_LIST_APPEND(kvar_cases_0, lstend_3, node_3);

               _fx_catch_6: ;
                  _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&tup_1);
                  if (v_25) {
                     _fx_free_N14K_form__ktyp_t(&v_25);
                  }
                  if (t_3) {
                     _fx_free_N10Ast__typ_t(&t_3);
                  }
                  FX_CHECK_EXN(_fx_catch_17);
               }
               int s_0 = !lst_5 + !lst_6;
               FX_CHECK_EQ_SIZE(s_0 == 0 || s_0 == 2, _fx_catch_17);
               _fx_LT2R9Ast__id_tLR9Ast__id_t lstend_4 = 0;
               FX_COPY_PTR(dvar_ifaces_0, &dvar_ifaces_1);
               _fx_LT2R9Ast__id_tLTa2R9Ast__id_t lst_7 = dvar_ifaces_1;
               for (; lst_7; lst_7 = lst_7->tl) {
                  _fx_LTa2R9Ast__id_t meths_0 = 0;
                  _fx_LR9Ast__id_t v_26 = 0;
                  _fx_T2R9Ast__id_tLR9Ast__id_t tup_2 = {0};
                  _fx_T2R9Ast__id_tLTa2R9Ast__id_t* __pat___3 = &lst_7->hd;
                  _fx_R9Ast__id_t iname_0 = __pat___3->t0;
                  FX_COPY_PTR(__pat___3->t1, &meths_0);
                  _fx_LR9Ast__id_t lstend_5 = 0;
                  _fx_LTa2R9Ast__id_t lst_8 = meths_0;
                  for (; lst_8; lst_8 = lst_8->tl) {
                     fx_str_t v_27 = {0};
                     fx_str_t v_28 = {0};
                     fx_str_t v_29 = {0};
                     fx_str_t v_30 = {0};
                     fx_str_t v_31 = {0};
                     fx_str_t v_32 = {0};
                     fx_str_t v_33 = {0};
                     fx_str_t v_34 = {0};
                     fx_str_t v_35 = {0};
                     fx_exn_t v_36 = {0};
                     _fx_Ta2R9Ast__id_t* __pat___4 = &lst_8->hd;
                     _fx_R9Ast__id_t a_0 = __pat___4->t0;
                     _fx_R9Ast__id_t b_0 = __pat___4->t1;
                     bool res_4;
                     FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&b_0, &_fx_g9Ast__noid, &res_4, 0), _fx_catch_7);
                     if (res_4) {
                        FX_CALL(_fx_M3AstFM2ppS1RM4id_t(dvar_name_0, &v_27, 0), _fx_catch_7);
                        FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_27, &v_28, 0), _fx_catch_7);
                        FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&iname_0, &v_29, 0), _fx_catch_7);
                        FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_29, &v_30, 0), _fx_catch_7);
                        FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&iname_0, &v_31, 0), _fx_catch_7);
                        FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_31, &v_32, 0), _fx_catch_7);
                        FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&a_0, &v_33, 0), _fx_catch_7);
                        FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_33, &v_34, 0), _fx_catch_7);
                        fx_str_t slit_3 = FX_MAKE_STR("type \'");
                        fx_str_t slit_4 = FX_MAKE_STR(" claims to implement interface \'");
                        fx_str_t slit_5 = FX_MAKE_STR("\', but the method \'");
                        fx_str_t slit_6 = FX_MAKE_STR(".");
                        fx_str_t slit_7 = FX_MAKE_STR("\' is not implemented");
                        {
                           const fx_str_t strs_1[] = { slit_3, v_28, slit_4, v_30, slit_5, v_32, slit_6, v_34, slit_7 };
                           FX_CALL(fx_strjoin(0, 0, 0, strs_1, 9, &v_35), _fx_catch_7);
                        }
                        FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(inst_loc_0, &v_35, &v_36, 0), _fx_catch_7);
                        FX_THROW(&v_36, false, _fx_catch_7);
                     }
                     _fx_LR9Ast__id_t node_4 = 0;
                     FX_CALL(_fx_cons_LR9Ast__id_t(&b_0, 0, false, &node_4), _fx_catch_7);
                     FX_LIST_APPEND(v_26, lstend_5, node_4);

                  _fx_catch_7: ;
                     fx_free_exn(&v_36);
                     FX_FREE_STR(&v_35);
                     FX_FREE_STR(&v_34);
                     FX_FREE_STR(&v_33);
                     FX_FREE_STR(&v_32);
                     FX_FREE_STR(&v_31);
                     FX_FREE_STR(&v_30);
                     FX_FREE_STR(&v_29);
                     FX_FREE_STR(&v_28);
                     FX_FREE_STR(&v_27);
                     FX_CHECK_EXN(_fx_catch_8);
                  }
                  _fx_make_T2R9Ast__id_tLR9Ast__id_t(&iname_0, v_26, &tup_2);
                  _fx_LT2R9Ast__id_tLR9Ast__id_t node_5 = 0;
                  FX_CALL(_fx_cons_LT2R9Ast__id_tLR9Ast__id_t(&tup_2, 0, false, &node_5), _fx_catch_8);
                  FX_LIST_APPEND(kvar_ifaces_0, lstend_4, node_5);

               _fx_catch_8: ;
                  _fx_free_T2R9Ast__id_tLR9Ast__id_t(&tup_2);
                  FX_FREE_LIST_SIMPLE(&v_26);
                  FX_FREE_LIST_SIMPLE(&meths_0);
                  FX_CHECK_EXN(_fx_catch_17);
               }
               fx_str_t slit_8 = FX_MAKE_STR("");
               _fx_make_R21K_form__kdefvariant_t(inst_name_0, &slit_8, &_fx_g9Ast__noid, &_fx_g19K_normalize__None4_, targs_0,
                  kvar_cases_0, dvar_ctors_0, dvar_flags_0, kvar_ifaces_0, sc_0, inst_loc_0, &v_22);
               FX_CALL(_fx_make_rR21K_form__kdefvariant_t(&v_22, &kvar_0), _fx_catch_17);
               _fx_M6K_formFM8KVariantN15K_form__kinfo_t1rRM13kdefvariant_t(kvar_0, &v_23);
               FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(inst_name_0, &v_23, 0), _fx_catch_17);
               FX_CALL(_fx_M6K_formFM11KDefVariantN14K_form__kexp_t1rRM13kdefvariant_t(kvar_0, &v_24), _fx_catch_17);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(v_24, code_2, true, &code_3), _fx_catch_17);
               FX_CALL(_fx_M6K_formFM8KTypNameN14K_form__ktyp_t1R9Ast__id_t(inst_name_0, &new_rt_0), _fx_catch_17);
               FX_COPY_PTR(code_3, &__fold_result___2);
               int_ i_2 = 0;
               FX_COPY_PTR(dvar_ctors_0, &dvar_ctors_1);
               _fx_LR9Ast__id_t lst_9 = dvar_ctors_1;
               _fx_LR9Ast__id_t lst_10 = tags_0;
               for (; lst_9 && lst_10; lst_10 = lst_10->tl, lst_9 = lst_9->tl, i_2 += 1) {
                  _fx_LN14K_form__kexp_t code_4 = 0;
                  _fx_N14Ast__id_info_t v_37 = {0};
                  _fx_LN14K_form__kexp_t v_38 = 0;
                  _fx_R9Ast__id_t* tag_2 = &lst_10->hd;
                  _fx_R9Ast__id_t* ctor_0 = &lst_9->hd;
                  FX_COPY_PTR(__fold_result___2, &code_4);
                  FX_CALL(_fx_M3AstFM7id_infoN14Ast__id_info_t2RM4id_tRM5loc_t(ctor_0, dvar_loc_0, &v_37, 0), _fx_catch_16);
                  if (v_37.tag == 3) {
                     _fx_R13Ast__deffun_t v_39 = {0};
                     _fx_LN10Ast__typ_t argtyps_0 = 0;
                     _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_40 = {0};
                     _fx_LN14K_form__ktyp_t kargtyps_0 = 0;
                     _fx_copy_R13Ast__deffun_t(&v_37.u.IdFun->data, &v_39);
                     _fx_N10Ast__typ_t df_typ_0 = v_39.df_typ;
                     _fx_R9Ast__id_t* df_name_0 = &v_39.df_name;
                     int tag_3 = FX_REC_VARIANT_TAG(df_typ_0);
                     if (tag_3 == 14) {
                        _fx_LN10Ast__typ_t v_41 = df_typ_0->u.TypFun.t0;
                        if (v_41 != 0) {
                           if (v_41->tl == 0) {
                              _fx_N10Ast__typ_t v_42 = v_41->hd;
                              if (FX_REC_VARIANT_TAG(v_42) == 20) {
                                 _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
                                    &v_42->u.TypRecord->data, &v_40);
                                 if (v_40.t1 == true) {
                                    _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_1 = 0;
                                    _fx_LN10Ast__typ_t lstend_6 = 0;
                                    FX_COPY_PTR(v_40.t0, &relems_1);
                                    _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_11 = relems_1;
                                    for (; lst_11; lst_11 = lst_11->tl) {
                                       _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* __pat___5 = &lst_11->hd;
                                       _fx_LN10Ast__typ_t node_6 = 0;
                                       FX_CALL(_fx_cons_LN10Ast__typ_t(__pat___5->t2, 0, false, &node_6), _fx_catch_9);
                                       FX_LIST_APPEND(argtyps_0, lstend_6, node_6);

                                    _fx_catch_9: ;
                                       FX_CHECK_EXN(_fx_catch_10);
                                    }

                                 _fx_catch_10: ;
                                    if (relems_1) {
                                       _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_1);
                                    }
                                    goto _fx_endmatch_0;
                                 }
                              }
                           }
                        }
                     }
                     if (tag_3 == 14) {
                        FX_COPY_PTR(df_typ_0->u.TypFun.t0, &argtyps_0); goto _fx_endmatch_0;
                     }

                  _fx_endmatch_0: ;
                     FX_CHECK_EXN(_fx_catch_14);
                     _fx_LN14K_form__ktyp_t lstend_7 = 0;
                     _fx_LN10Ast__typ_t lst_12 = argtyps_0;
                     for (; lst_12; lst_12 = lst_12->tl) {
                        _fx_N14K_form__ktyp_t res_5 = 0;
                        _fx_N10Ast__typ_t t_4 = lst_12->hd;
                        FX_CALL(
                           _fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(t_4, dvar_loc_0, &res_5,
                              0), _fx_catch_11);
                        _fx_LN14K_form__ktyp_t node_7 = 0;
                        FX_CALL(_fx_cons_LN14K_form__ktyp_t(res_5, 0, false, &node_7), _fx_catch_11);
                        FX_LIST_APPEND(kargtyps_0, lstend_7, node_7);

                     _fx_catch_11: ;
                        if (res_5) {
                           _fx_free_N14K_form__ktyp_t(&res_5);
                        }
                        FX_CHECK_EXN(_fx_catch_14);
                     }
                     int_ tagval_0 = i_2 + 1;
                     if (kargtyps_0 == 0) {
                        _fx_N14K_form__atom_t v_43 = {0};
                        _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_44 = {0};
                        _fx_N14K_form__kexp_t e0_0 = 0;
                        _fx_R16Ast__val_flags_t v_45 = {0};
                        _fx_R16Ast__val_flags_t cflags_0 = {0};
                        _fx_Nt6option1N14K_form__kexp_t v_46 = {0};
                        _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(tag_2, &v_43);
                        _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(new_rt_0, dvar_loc_0, &v_44);
                        FX_CALL(
                           _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_43,
                              &v_44, &e0_0), _fx_catch_12);
                        FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_45, 0), _fx_catch_12);
                        _fx_make_R16Ast__val_flags_t(v_45.val_flag_arg, true, v_45.val_flag_temp, v_45.val_flag_tempref,
                           v_45.val_flag_private, v_45.val_flag_subarray, dvar_flags_0->var_flag_instance,
                           &v_45.val_flag_method, tagval_0, sc_0, &cflags_0);
                        _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(e0_0, &v_46);
                        FX_CALL(
                           _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
                              df_name_0, new_rt_0, &cflags_0, &v_46, code_4, dvar_loc_0, &v_38, 0), _fx_catch_12);

                     _fx_catch_12: ;
                        _fx_free_Nt6option1N14K_form__kexp_t(&v_46);
                        _fx_free_R16Ast__val_flags_t(&cflags_0);
                        _fx_free_R16Ast__val_flags_t(&v_45);
                        if (e0_0) {
                           _fx_free_N14K_form__kexp_t(&e0_0);
                        }
                        _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_44);
                        _fx_free_N14K_form__atom_t(&v_43);
                     }
                     else {
                        _fx_N17Ast__fun_constr_t v_47;
                        _fx_M3AstFM11CtorVariantN17Ast__fun_constr_t1i(tagval_0, &v_47);
                        FX_CALL(
                           _fx_M6K_formFM17create_kdefconstrLN14K_form__kexp_t8R9Ast__id_tLN14K_form__ktyp_tN14K_form__ktyp_tN17Ast__fun_constr_tBLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_t(
                              df_name_0, kargtyps_0, new_rt_0, &v_47, dvar_flags_0->var_flag_instance, code_4, sc_0, dvar_loc_0,
                              &v_38, 0), _fx_catch_13);

                     _fx_catch_13: ;
                     }
                     FX_CHECK_EXN(_fx_catch_14);

                  _fx_catch_14: ;
                     if (kargtyps_0) {
                        _fx_free_LN14K_form__ktyp_t(&kargtyps_0);
                     }
                     _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_40);
                     if (argtyps_0) {
                        _fx_free_LN10Ast__typ_t(&argtyps_0);
                     }
                     _fx_free_R13Ast__deffun_t(&v_39);
                  }
                  else {
                     fx_str_t v_48 = {0};
                     fx_str_t v_49 = {0};
                     fx_str_t v_50 = {0};
                     fx_exn_t v_51 = {0};
                     FX_CALL(_fx_M3AstFM6stringS1RM4id_t(ctor_0, &v_48, 0), _fx_catch_15);
                     FX_CALL(_fx_M3AstFM6stringS1RM4id_t(inst_0, &v_49, 0), _fx_catch_15);
                     fx_str_t slit_9 = FX_MAKE_STR("the constructor \'");
                     fx_str_t slit_10 = FX_MAKE_STR("\' of variant \'");
                     fx_str_t slit_11 = FX_MAKE_STR("\' is not a function apparently");
                     {
                        const fx_str_t strs_2[] = { slit_9, v_48, slit_10, v_49, slit_11 };
                        FX_CALL(fx_strjoin(0, 0, 0, strs_2, 5, &v_50), _fx_catch_15);
                     }
                     FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(dvar_loc_0, &v_50, &v_51, 0), _fx_catch_15);
                     FX_THROW(&v_51, false, _fx_catch_15);

                  _fx_catch_15: ;
                     fx_free_exn(&v_51);
                     FX_FREE_STR(&v_50);
                     FX_FREE_STR(&v_49);
                     FX_FREE_STR(&v_48);
                  }
                  FX_CHECK_EXN(_fx_catch_16);
                  _fx_free_LN14K_form__kexp_t(&__fold_result___2);
                  FX_COPY_PTR(v_38, &__fold_result___2);

               _fx_catch_16: ;
                  if (v_38) {
                     _fx_free_LN14K_form__kexp_t(&v_38);
                  }
                  _fx_free_N14Ast__id_info_t(&v_37);
                  if (code_4) {
                     _fx_free_LN14K_form__kexp_t(&code_4);
                  }
                  FX_CHECK_EXN(_fx_catch_17);
               }
               int s_1 = !lst_9 + !lst_10;
               FX_CHECK_EQ_SIZE(s_1 == 0 || s_1 == 2, _fx_catch_17);
               FX_COPY_PTR(__fold_result___2, &v_9);

            _fx_catch_17: ;
               FX_FREE_LIST_SIMPLE(&dvar_ctors_1);
               if (__fold_result___2) {
                  _fx_free_LN14K_form__kexp_t(&__fold_result___2);
               }
               if (new_rt_0) {
                  _fx_free_N14K_form__ktyp_t(&new_rt_0);
               }
               if (code_3) {
                  _fx_free_LN14K_form__kexp_t(&code_3);
               }
               if (v_24) {
                  _fx_free_N14K_form__kexp_t(&v_24);
               }
               _fx_free_N15K_form__kinfo_t(&v_23);
               if (kvar_0) {
                  _fx_free_rR21K_form__kdefvariant_t(&kvar_0);
               }
               _fx_free_R21K_form__kdefvariant_t(&v_22);
               if (dvar_ifaces_1) {
                  _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(&dvar_ifaces_1);
               }
               if (kvar_ifaces_0) {
                  _fx_free_LT2R9Ast__id_tLR9Ast__id_t(&kvar_ifaces_0);
               }
               if (dvar_cases_2) {
                  _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&dvar_cases_2);
               }
               if (kvar_cases_0) {
                  _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kvar_cases_0);
               }

            _fx_endmatch_1: ;
               FX_CHECK_EXN(_fx_catch_18);

            _fx_catch_18: ;
               if (targs_0) {
                  _fx_free_LN14K_form__ktyp_t(&targs_0);
               }
               if (v_11) {
                  _fx_free_N10Ast__typ_t(&v_11);
               }
               _fx_free_R17Ast__defvariant_t(&v_10);
            }
            else {
               fx_str_t v_52 = {0};
               fx_str_t v_53 = {0};
               fx_str_t v_54 = {0};
               fx_exn_t v_55 = {0};
               FX_CALL(_fx_M3AstFM6stringS1RM4id_t(inst_0, &v_52, 0), _fx_catch_19);
               FX_CALL(_fx_M3AstFM6stringS1RM4id_t(dvar_name_0, &v_53, 0), _fx_catch_19);
               fx_str_t slit_12 = FX_MAKE_STR("the instance \'");
               fx_str_t slit_13 = FX_MAKE_STR("\' of variant \'");
               fx_str_t slit_14 = FX_MAKE_STR("\' is not a variant");
               {
                  const fx_str_t strs_3[] = { slit_12, v_52, slit_13, v_53, slit_14 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_3, 5, &v_54), _fx_catch_19);
               }
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(dvar_loc_0, &v_54, &v_55, 0), _fx_catch_19);
               FX_THROW(&v_55, false, _fx_catch_19);

            _fx_catch_19: ;
               fx_free_exn(&v_55);
               FX_FREE_STR(&v_54);
               FX_FREE_STR(&v_53);
               FX_FREE_STR(&v_52);
            }
            FX_CHECK_EXN(_fx_catch_20);
            _fx_free_LN14K_form__kexp_t(&__fold_result___1);
            FX_COPY_PTR(v_9, &__fold_result___1);

         _fx_catch_20: ;
            if (v_9) {
               _fx_free_LN14K_form__kexp_t(&v_9);
            }
            _fx_free_N14Ast__id_info_t(&v_8);
            if (code_2) {
               _fx_free_LN14K_form__kexp_t(&code_2);
            }
            FX_CHECK_EXN(_fx_catch_21);
         }
         FX_COPY_PTR(__fold_result___1, &v_0);

      _fx_catch_21: ;
         if (__fold_result___1) {
            _fx_free_LN14K_form__kexp_t(&__fold_result___1);
         }
         if (dvar_cases_0) {
            _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&dvar_cases_0);
         }
         FX_FREE_LIST_SIMPLE(&tags_0);
         FX_FREE_LIST_SIMPLE(&inst_list_0);
         _fx_free_R17Ast__defvariant_t(&v_1);
      }
      else if (tag_0 == 36) {
         _fx_R13Ast__defexn_t v_56 = {0};
         _fx_N10Ast__typ_t v_57 = 0;
         fx_str_t v_58 = {0};
         fx_str_t v_59 = {0};
         fx_str_t v_60 = {0};
         _fx_LN12Ast__scope_t tag_sc_0 = 0;
         _fx_R16Ast__val_flags_t v_61 = {0};
         _fx_R16Ast__val_flags_t tag_flags_1 = {0};
         _fx_N14K_form__klit_t v_62 = {0};
         _fx_N14K_form__atom_t v_63 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_64 = {0};
         _fx_N14K_form__kexp_t v_65 = 0;
         _fx_Nt6option1N14K_form__kexp_t v_66 = {0};
         _fx_LN14K_form__kexp_t decl_tag_0 = 0;
         _fx_LN14K_form__kexp_t code_5 = 0;
         _fx_N10Ast__typ_t v_67 = 0;
         _fx_N10Ast__typ_t dexn_typ_0 = 0;
         _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_68 = {0};
         _fx_N14K_form__ktyp_t ke_typ_0 = 0;
         _fx_T2R9Ast__id_tLN14K_form__kexp_t v_69 = {0};
         _fx_LN14K_form__kexp_t delta_code_0 = 0;
         _fx_R17K_form__kdefexn_t v_70 = {0};
         _fx_rR17K_form__kdefexn_t ke_0 = 0;
         _fx_N15K_form__kinfo_t v_71 = {0};
         _fx_N14K_form__kexp_t v_72 = 0;
         _fx_LN14K_form__kexp_t v_73 = 0;
         _fx_copy_R13Ast__defexn_t(&e_0->u.DefExn->data, &v_56);
         _fx_LN12Ast__scope_t dexn_scope_0 = v_56.dexn_scope;
         _fx_R10Ast__loc_t* dexn_loc_0 = &v_56.dexn_loc;
         _fx_N10Ast__typ_t dexn_typ_1 = v_56.dexn_typ;
         _fx_R9Ast__id_t* dexn_name_0 = &v_56.dexn_name;
         FX_CALL(_fx_M3AstFM9deref_typN10Ast__typ_t1N10Ast__typ_t(dexn_typ_1, &v_57, 0), _fx_catch_27);
         bool is_std_0;
         if (FX_REC_VARIANT_TAG(v_57) == 13) {
            if (dexn_scope_0 != 0) {
               _fx_N12Ast__scope_t* v_74 = &dexn_scope_0->hd;
               if (v_74->tag == 10) {
                  _fx_R9Ast__id_t v_75;
                  FX_CALL(_fx_M3AstFM15get_module_nameRM4id_t1i(v_74->u.ScModule, &v_75, 0), _fx_catch_27);
                  FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&v_75, &v_58, 0), _fx_catch_27);
                  fx_str_t slit_15 = FX_MAKE_STR("Builtins");
                  if (_fx_F6__eq__B2SS(&v_58, &slit_15, 0)) {
                     fx_str_t exn_name_str_0 = {0};
                     FX_CALL(_fx_M3AstFM2ppS1RM4id_t(dexn_name_0, &exn_name_str_0, 0), _fx_catch_22);
                     bool v_76;
                     fx_str_t slit_16 = FX_MAKE_STR("OutOfRangeError");
                     v_76 = _fx_F6__eq__B2SS(&exn_name_str_0, &slit_16, 0);
                     if (v_76) {
                        _fx_g35K_form__builtin_exn_OutOfRangeError = *dexn_name_0;
                     }
                     else {
                        bool v_77;
                        fx_str_t slit_17 = FX_MAKE_STR("NoMatchError");
                        v_77 = _fx_F6__eq__B2SS(&exn_name_str_0, &slit_17, 0);
                        if (v_77) {
                           _fx_g32K_form__builtin_exn_NoMatchError = *dexn_name_0;
                        }
                     }
                     is_std_0 = true;

                  _fx_catch_22: ;
                     FX_FREE_STR(&exn_name_str_0);
                     goto _fx_endmatch_2;
                  }
               }
            }
         }
         is_std_0 = false;

      _fx_endmatch_2: ;
         FX_CHECK_EXN(_fx_catch_27);
         FX_CALL(_fx_M3AstFM2ppS1RM4id_t(dexn_name_0, &v_59, 0), _fx_catch_27);
         fx_str_t slit_18 = FX_MAKE_STR("_tag");
         {
            const fx_str_t strs_4[] = { v_59, slit_18 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_4, 2, &v_60), _fx_catch_27);
         }
         _fx_R9Ast__id_t tagname_0;
         FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, &v_60, &tagname_0, 0), _fx_catch_27);
         FX_CALL(_fx_M3AstFM16get_module_scopeLN12Ast__scope_t1LN12Ast__scope_t(sc_0, &tag_sc_0, 0), _fx_catch_27);
         FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_61, 0), _fx_catch_27);
         _fx_make_R16Ast__val_flags_t(v_61.val_flag_arg, true, v_61.val_flag_temp, v_61.val_flag_tempref, v_61.val_flag_private,
            v_61.val_flag_subarray, v_61.val_flag_instance, &v_61.val_flag_method, v_61.val_flag_ctor, tag_sc_0, &tag_flags_1);
         _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(0LL, &v_62);
         _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_62, &v_63);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g20K_normalize__KTypInt, dexn_loc_0, &v_64);
         FX_CALL(
            _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_63, &v_64, &v_65),
            _fx_catch_27);
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(v_65, &v_66);
         FX_CALL(
            _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
               &tagname_0, _fx_g21K_normalize__KTypCInt, &tag_flags_1, &v_66, 0, dexn_loc_0, &decl_tag_0, 0), _fx_catch_27);
         if (is_std_0) {
            FX_COPY_PTR(code_1, &code_5);
         }
         else {
            FX_CALL(
               _fx_M11K_normalizeFM7__add__LN14K_form__kexp_t2LN14K_form__kexp_tLN14K_form__kexp_t(decl_tag_0, code_1, &code_5,
                  0), _fx_catch_27);
         }
         FX_CALL(_fx_M3AstFM9deref_typN10Ast__typ_t1N10Ast__typ_t(dexn_typ_1, &v_67, 0), _fx_catch_27);
         if (FX_REC_VARIANT_TAG(v_67) == 20) {
            _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_67->u.TypRecord->data, &v_68);
            if (v_68.t1 == true) {
               _fx_LN10Ast__typ_t v_78 = 0;
               _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_2 = 0;
               _fx_LN10Ast__typ_t lstend_8 = 0;
               FX_COPY_PTR(v_68.t0, &relems_2);
               _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_13 = relems_2;
               for (; lst_13; lst_13 = lst_13->tl) {
                  _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* __pat___6 = &lst_13->hd;
                  _fx_LN10Ast__typ_t node_8 = 0;
                  FX_CALL(_fx_cons_LN10Ast__typ_t(__pat___6->t2, 0, false, &node_8), _fx_catch_23);
                  FX_LIST_APPEND(v_78, lstend_8, node_8);

               _fx_catch_23: ;
                  FX_CHECK_EXN(_fx_catch_24);
               }
               FX_CALL(_fx_M3AstFM8TypTupleN10Ast__typ_t1LN10Ast__typ_t(v_78, &dexn_typ_0), _fx_catch_24);

            _fx_catch_24: ;
               if (relems_2) {
                  _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_2);
               }
               if (v_78) {
                  _fx_free_LN10Ast__typ_t(&v_78);
               }
               goto _fx_endmatch_3;
            }
         }
         FX_COPY_PTR(dexn_typ_1, &dexn_typ_0);

      _fx_endmatch_3: ;
         FX_CHECK_EXN(_fx_catch_27);
         FX_CALL(
            _fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(dexn_typ_0, dexn_loc_0, &ke_typ_0, 0),
            _fx_catch_27);
         if (FX_REC_VARIANT_TAG(ke_typ_0) == 7) {
            _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&_fx_g9Ast__noid, 0, &v_69);
         }
         else {
            fx_str_t v_79 = {0};
            fx_str_t v_80 = {0};
            _fx_LN14K_form__ktyp_t argtyps_1 = 0;
            _fx_LN14K_form__kexp_t delta_code_1 = 0;
            FX_CALL(_fx_M3AstFM2ppS1RM4id_t(dexn_name_0, &v_79, 0), _fx_catch_26);
            fx_str_t slit_19 = FX_MAKE_STR("make_");
            {
               const fx_str_t strs_5[] = { slit_19, v_79 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_5, 2, &v_80), _fx_catch_26);
            }
            _fx_R9Ast__id_t make_id_0;
            FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, &v_80, &make_id_0, 0), _fx_catch_26);
            if (FX_REC_VARIANT_TAG(ke_typ_0) == 14) {
               FX_COPY_PTR(ke_typ_0->u.KTypTuple, &argtyps_1);
            }
            else {
               FX_CALL(_fx_cons_LN14K_form__ktyp_t(ke_typ_0, 0, true, &argtyps_1), _fx_catch_25);  _fx_catch_25: ;
            }
            FX_CHECK_EXN(_fx_catch_26);
            _fx_N17Ast__fun_constr_t v_81;
            _fx_M3AstFM7CtorExnN17Ast__fun_constr_t1RM4id_t(dexn_name_0, &v_81);
            FX_CALL(
               _fx_M6K_formFM17create_kdefconstrLN14K_form__kexp_t8R9Ast__id_tLN14K_form__ktyp_tN14K_form__ktyp_tN17Ast__fun_constr_tBLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_t(
                  &make_id_0, argtyps_1, _fx_g20K_normalize__KTypExn, &v_81, false, 0, dexn_scope_0, dexn_loc_0, &delta_code_1,
                  0), _fx_catch_26);
            _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&make_id_0, delta_code_1, &v_69);

         _fx_catch_26: ;
            if (delta_code_1) {
               _fx_free_LN14K_form__kexp_t(&delta_code_1);
            }
            if (argtyps_1) {
               _fx_free_LN14K_form__ktyp_t(&argtyps_1);
            }
            FX_FREE_STR(&v_80);
            FX_FREE_STR(&v_79);
         }
         FX_CHECK_EXN(_fx_catch_27);
         _fx_R9Ast__id_t make_id_1 = v_69.t0;
         FX_COPY_PTR(v_69.t1, &delta_code_0);
         fx_str_t slit_20 = FX_MAKE_STR("");
         fx_str_t slit_21 = FX_MAKE_STR("");
         _fx_make_R17K_form__kdefexn_t(dexn_name_0, &slit_20, &slit_21, ke_typ_0, is_std_0, &tagname_0, &make_id_1, sc_0,
            dexn_loc_0, &v_70);
         FX_CALL(_fx_make_rR17K_form__kdefexn_t(&v_70, &ke_0), _fx_catch_27);
         _fx_M6K_formFM4KExnN15K_form__kinfo_t1rRM9kdefexn_t(ke_0, &v_71);
         FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(dexn_name_0, &v_71, 0), _fx_catch_27);
         FX_CALL(_fx_M6K_formFM7KDefExnN14K_form__kexp_t1rRM9kdefexn_t(ke_0, &v_72), _fx_catch_27);
         FX_CALL(_fx_cons_LN14K_form__kexp_t(v_72, code_5, true, &v_73), _fx_catch_27);
         FX_CALL(
            _fx_M11K_normalizeFM7__add__LN14K_form__kexp_t2LN14K_form__kexp_tLN14K_form__kexp_t(delta_code_0, v_73, &v_0, 0),
            _fx_catch_27);

      _fx_catch_27: ;
         if (v_73) {
            _fx_free_LN14K_form__kexp_t(&v_73);
         }
         if (v_72) {
            _fx_free_N14K_form__kexp_t(&v_72);
         }
         _fx_free_N15K_form__kinfo_t(&v_71);
         if (ke_0) {
            _fx_free_rR17K_form__kdefexn_t(&ke_0);
         }
         _fx_free_R17K_form__kdefexn_t(&v_70);
         if (delta_code_0) {
            _fx_free_LN14K_form__kexp_t(&delta_code_0);
         }
         _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(&v_69);
         if (ke_typ_0) {
            _fx_free_N14K_form__ktyp_t(&ke_typ_0);
         }
         _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_68);
         if (dexn_typ_0) {
            _fx_free_N10Ast__typ_t(&dexn_typ_0);
         }
         if (v_67) {
            _fx_free_N10Ast__typ_t(&v_67);
         }
         if (code_5) {
            _fx_free_LN14K_form__kexp_t(&code_5);
         }
         if (decl_tag_0) {
            _fx_free_LN14K_form__kexp_t(&decl_tag_0);
         }
         _fx_free_Nt6option1N14K_form__kexp_t(&v_66);
         if (v_65) {
            _fx_free_N14K_form__kexp_t(&v_65);
         }
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_64);
         _fx_free_N14K_form__atom_t(&v_63);
         _fx_free_N14K_form__klit_t(&v_62);
         _fx_free_R16Ast__val_flags_t(&tag_flags_1);
         _fx_free_R16Ast__val_flags_t(&v_61);
         FX_FREE_LIST_SIMPLE(&tag_sc_0);
         FX_FREE_STR(&v_60);
         FX_FREE_STR(&v_59);
         FX_FREE_STR(&v_58);
         if (v_57) {
            _fx_free_N10Ast__typ_t(&v_57);
         }
         _fx_free_R13Ast__defexn_t(&v_56);
      }
      else if (tag_0 == 39) {
         _fx_R19Ast__definterface_t v_82 = {0};
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t ki_all_methods_0 = 0;
         _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t di_all_methods_0 = 0;
         fx_str_t v_83 = {0};
         fx_str_t v_84 = {0};
         _fx_R16Ast__val_flags_t v_85 = {0};
         _fx_R16Ast__val_flags_t v_86 = {0};
         _fx_N14K_form__klit_t v_87 = {0};
         _fx_N14K_form__atom_t v_88 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_89 = {0};
         _fx_N14K_form__kexp_t v_90 = 0;
         _fx_Nt6option1N14K_form__kexp_t v_91 = {0};
         _fx_LN14K_form__kexp_t code_6 = 0;
         _fx_R23K_form__kdefinterface_t v_92 = {0};
         _fx_rR23K_form__kdefinterface_t ki_0 = 0;
         _fx_N15K_form__kinfo_t v_93 = {0};
         _fx_N14K_form__kexp_t v_94 = 0;
         _fx_copy_R19Ast__definterface_t(&e_0->u.DefInterface->data, &v_82);
         _fx_R10Ast__loc_t* di_loc_0 = &v_82.di_loc;
         _fx_LN12Ast__scope_t di_scope_0 = v_82.di_scope;
         _fx_R9Ast__id_t* di_name_0 = &v_82.di_name;
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t lstend_9 = 0;
         FX_COPY_PTR(v_82.di_all_methods, &di_all_methods_0);
         _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t lst_14 = di_all_methods_0;
         for (; lst_14; lst_14 = lst_14->tl) {
            _fx_N10Ast__typ_t t_5 = 0;
            _fx_N14K_form__ktyp_t ktyp_0 = 0;
            _fx_N14Ast__id_info_t v_95 = {0};
            _fx_R13Ast__defval_t dv_0 = {0};
            _fx_R16Ast__val_flags_t v_96 = {0};
            _fx_LN14K_form__kexp_t res_6 = 0;
            _fx_T2R9Ast__id_tN14K_form__ktyp_t tup_3 = {0};
            _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* __pat___7 = &lst_14->hd;
            _fx_R9Ast__id_t f_0 = __pat___7->t0;
            FX_COPY_PTR(__pat___7->t1, &t_5);
            FX_CALL(_fx_M11K_normalizeFM8typ2ktypN14K_form__ktyp_t2N10Ast__typ_tR10Ast__loc_t(t_5, di_loc_0, &ktyp_0, 0),
               _fx_catch_29);
            FX_CALL(_fx_M3AstFM7id_infoN14Ast__id_info_t2RM4id_tRM5loc_t(&f_0, di_loc_0, &v_95, 0), _fx_catch_29);
            if (v_95.tag == 2) {
               _fx_copy_R13Ast__defval_t(&v_95.u.IdDVal, &dv_0);
            }
            else {
               fx_str_t v_97 = {0};
               fx_str_t v_98 = {0};
               fx_str_t v_99 = {0};
               fx_str_t v_100 = {0};
               fx_str_t v_101 = {0};
               fx_exn_t v_102 = {0};
               FX_CALL(_fx_M3AstFM2ppS1RM4id_t(di_name_0, &v_97, 0), _fx_catch_28);
               FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_97, &v_98, 0), _fx_catch_28);
               FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&f_0, &v_99, 0), _fx_catch_28);
               FX_CALL(_fx_M11K_normalizeFM6stringS1S(&v_99, &v_100, 0), _fx_catch_28);
               fx_str_t slit_22 = FX_MAKE_STR("description of method \'");
               fx_str_t slit_23 = FX_MAKE_STR(".");
               fx_str_t slit_24 = FX_MAKE_STR("\' is not found");
               {
                  const fx_str_t strs_6[] = { slit_22, v_98, slit_23, v_100, slit_24 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_6, 5, &v_101), _fx_catch_28);
               }
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(di_loc_0, &v_101, &v_102, 0), _fx_catch_28);
               FX_THROW(&v_102, false, _fx_catch_28);

            _fx_catch_28: ;
               fx_free_exn(&v_102);
               FX_FREE_STR(&v_101);
               FX_FREE_STR(&v_100);
               FX_FREE_STR(&v_99);
               FX_FREE_STR(&v_98);
               FX_FREE_STR(&v_97);
            }
            FX_CHECK_EXN(_fx_catch_29);
            _fx_copy_R16Ast__val_flags_t(&dv_0.dv_flags, &v_96);
            FX_CALL(
               _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
                  &f_0, ktyp_0, &v_96, &_fx_g19K_normalize__None3_, 0, di_loc_0, &res_6, 0), _fx_catch_29);
            _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(&f_0, ktyp_0, &tup_3);
            _fx_LT2R9Ast__id_tN14K_form__ktyp_t node_9 = 0;
            FX_CALL(_fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(&tup_3, 0, false, &node_9), _fx_catch_29);
            FX_LIST_APPEND(ki_all_methods_0, lstend_9, node_9);

         _fx_catch_29: ;
            _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&tup_3);
            if (res_6) {
               _fx_free_LN14K_form__kexp_t(&res_6);
            }
            _fx_free_R16Ast__val_flags_t(&v_96);
            _fx_free_R13Ast__defval_t(&dv_0);
            _fx_free_N14Ast__id_info_t(&v_95);
            if (ktyp_0) {
               _fx_free_N14K_form__ktyp_t(&ktyp_0);
            }
            if (t_5) {
               _fx_free_N10Ast__typ_t(&t_5);
            }
            FX_CHECK_EXN(_fx_catch_30);
         }
         FX_CALL(_fx_M3AstFM2ppS1RM4id_t(di_name_0, &v_83, 0), _fx_catch_30);
         fx_str_t slit_25 = FX_MAKE_STR("_id");
         {
            const fx_str_t strs_7[] = { v_83, slit_25 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_7, 2, &v_84), _fx_catch_30);
         }
         _fx_R9Ast__id_t ki_id_0;
         FX_CALL(_fx_M6K_formFM7gen_idkR9Ast__id_t2iS(km_idx_0, &v_84, &ki_id_0, 0), _fx_catch_30);
         FX_CALL(_fx_M3AstFM17default_var_flagsRM11val_flags_t0(&v_85, 0), _fx_catch_30);
         _fx_make_R16Ast__val_flags_t(v_85.val_flag_arg, v_85.val_flag_mutable, v_85.val_flag_temp, v_85.val_flag_tempref,
            v_85.val_flag_private, v_85.val_flag_subarray, v_85.val_flag_instance, &v_85.val_flag_method, v_85.val_flag_ctor,
            di_scope_0, &v_86);
         _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(-1LL, &v_87);
         _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_87, &v_88);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g21K_normalize__KTypCInt, di_loc_0, &v_89);
         FX_CALL(
            _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_88, &v_89, &v_90),
            _fx_catch_30);
         _fx_M11K_normalizeFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(v_90, &v_91);
         FX_CALL(
            _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
               &ki_id_0, _fx_g21K_normalize__KTypCInt, &v_86, &v_91, code_1, di_loc_0, &code_6, 0), _fx_catch_30);
         fx_str_t slit_26 = FX_MAKE_STR("");
         _fx_make_R23K_form__kdefinterface_t(di_name_0, &v_82.di_base, &slit_26, &ki_id_0, ki_all_methods_0, di_scope_0,
            di_loc_0, &v_92);
         FX_CALL(_fx_make_rR23K_form__kdefinterface_t(&v_92, &ki_0), _fx_catch_30);
         _fx_M6K_formFM10KInterfaceN15K_form__kinfo_t1rRM15kdefinterface_t(ki_0, &v_93);
         FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(di_name_0, &v_93, 0), _fx_catch_30);
         FX_CALL(_fx_M6K_formFM13KDefInterfaceN14K_form__kexp_t1rRM15kdefinterface_t(ki_0, &v_94), _fx_catch_30);
         FX_CALL(_fx_cons_LN14K_form__kexp_t(v_94, code_6, true, &v_0), _fx_catch_30);

      _fx_catch_30: ;
         if (v_94) {
            _fx_free_N14K_form__kexp_t(&v_94);
         }
         _fx_free_N15K_form__kinfo_t(&v_93);
         if (ki_0) {
            _fx_free_rR23K_form__kdefinterface_t(&ki_0);
         }
         _fx_free_R23K_form__kdefinterface_t(&v_92);
         if (code_6) {
            _fx_free_LN14K_form__kexp_t(&code_6);
         }
         _fx_free_Nt6option1N14K_form__kexp_t(&v_91);
         if (v_90) {
            _fx_free_N14K_form__kexp_t(&v_90);
         }
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_89);
         _fx_free_N14K_form__atom_t(&v_88);
         _fx_free_N14K_form__klit_t(&v_87);
         _fx_free_R16Ast__val_flags_t(&v_86);
         _fx_free_R16Ast__val_flags_t(&v_85);
         FX_FREE_STR(&v_84);
         FX_FREE_STR(&v_83);
         if (di_all_methods_0) {
            _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&di_all_methods_0);
         }
         if (ki_all_methods_0) {
            _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&ki_all_methods_0);
         }
         _fx_free_R19Ast__definterface_t(&v_82);
      }
      else {
         FX_COPY_PTR(code_1, &v_0);
      }
      FX_CHECK_EXN(_fx_catch_31);
      _fx_free_LN14K_form__kexp_t(&__fold_result___0);
      FX_COPY_PTR(v_0, &__fold_result___0);

   _fx_catch_31: ;
      if (v_0) {
         _fx_free_LN14K_form__kexp_t(&v_0);
      }
      if (code_1) {
         _fx_free_LN14K_form__kexp_t(&code_1);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LN14K_form__kexp_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM10embed_dataN14K_form__kexp_t3SST2N14K_form__ktyp_tR10Ast__loc_t(
   fx_str_t* kind_0,
   fx_str_t* fname_0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   fx_exn_t curr_exn_0 = {0};
   fx_str_t v_0 = {0};
   fx_exn_t v_1 = {0};
   fx_arr_t data_0 = {0};
   _fx_LT2BN14K_form__atom_t data_1 = 0;
   _fx_LLT2BN14K_form__atom_t v_2 = 0;
   _fx_N14K_form__ktyp_t v_3 = 0;
   _fx_N14K_form__ktyp_t v_4 = 0;
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_5 = {0};
   fx_str_t v_6 = {0};
   fx_exn_t v_7 = {0};
   int fx_status = 0;
   _fx_R10Ast__loc_t loc_0 = arg2_0->t1;
   bool v_8;
   fx_str_t slit_0 = FX_MAKE_STR("text");
   v_8 = _fx_F6__eq__B2SS(kind_0, &slit_0, 0);
   if (v_8) {
      fx_str_t text_0 = {0};
      _fx_N14K_form__klit_t v_9 = {0};
      _fx_N14K_form__atom_t v_10 = {0};
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_11 = {0};
      FX_CALL(_fx_M4FileFM9read_utf8S1S(fname_0, &text_0, 0), _fx_catch_0);
      _fx_M6K_formFM10KLitStringN14K_form__klit_t1S(&text_0, &v_9);
      _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_9, &v_10);
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g23K_normalize__KTypString, &loc_0, &v_11);
      FX_CALL(
         _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_10, &v_11, fx_result),
         _fx_catch_0);

   _fx_catch_0: ;
      FX_FREE_STR(&text_0);
      _fx_free_N14K_form__klit_t(&v_9);
      _fx_free_N14K_form__atom_t(&v_10);
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_11);
      if (fx_status < 0) {
         fx_exn_get_and_reset(fx_status, &curr_exn_0);
         fx_status = 0;
         if (*fx_result) {
            _fx_free_N14K_form__kexp_t(fx_result);
         }
         fx_str_t slit_1 = FX_MAKE_STR("@text: ");
         fx_str_t slit_2 = FX_MAKE_STR(" cannot be read");
         {
            const fx_str_t strs_0[] = { slit_1, *fname_0, slit_2 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_0), _fx_cleanup);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &v_0, &v_1, 0), _fx_cleanup);
         FX_THROW(&v_1, false, _fx_cleanup);
      }
   }
   else {
      bool v_12;
      fx_str_t slit_3 = FX_MAKE_STR("binary");
      v_12 = _fx_F6__eq__B2SS(kind_0, &slit_3, 0);
      if (v_12) {
         FX_CALL(_fx_M4FileFM14read_binary_u8A1b1S(fname_0, &data_0, 0), _fx_cleanup);
         _fx_LT2BN14K_form__atom_t lstend_0 = 0;
         int_ ni_0 = FX_ARR_SIZE(data_0, 0);
         uint8_t* ptr_data_0 = FX_PTR_1D(uint8_t, data_0, 0);
         for (int_ i_0 = 0; i_0 < ni_0; i_0++) {
            _fx_N14K_form__klit_t v_13 = {0};
            _fx_N14K_form__atom_t v_14 = {0};
            _fx_T2BN14K_form__atom_t tup_0 = {0};
            uint8_t i_1 = ptr_data_0[i_0];
            _fx_M6K_formFM8KLitUIntN14K_form__klit_t2iq(8, (uint64_t)i_1, &v_13);
            _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_13, &v_14);
            _fx_make_T2BN14K_form__atom_t(false, &v_14, &tup_0);
            _fx_LT2BN14K_form__atom_t node_0 = 0;
            FX_CALL(_fx_cons_LT2BN14K_form__atom_t(&tup_0, 0, false, &node_0), _fx_catch_1);
            FX_LIST_APPEND(data_1, lstend_0, node_0);

         _fx_catch_1: ;
            _fx_free_T2BN14K_form__atom_t(&tup_0);
            _fx_free_N14K_form__atom_t(&v_14);
            _fx_free_N14K_form__klit_t(&v_13);
            FX_CHECK_EXN(_fx_cleanup);
         }
         FX_CALL(_fx_cons_LLT2BN14K_form__atom_t(data_1, 0, true, &v_2), _fx_cleanup);
         FX_CALL(_fx_M6K_formFM8KTypUIntN14K_form__ktyp_t1i(8, &v_3), _fx_cleanup);
         FX_CALL(_fx_M6K_formFM9KTypArrayN14K_form__ktyp_t2iN14K_form__ktyp_t(1, v_3, &v_4), _fx_cleanup);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(v_4, &loc_0, &v_5);
         FX_CALL(
            _fx_M6K_formFM11KExpMkArrayN14K_form__kexp_t3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(true, v_2,
               &v_5, fx_result), _fx_cleanup);
      }
      else {
         fx_str_t slit_4 = FX_MAKE_STR("\'");
         fx_str_t slit_5 = FX_MAKE_STR("\' data is not supported");
         {
            const fx_str_t strs_1[] = { slit_4, *kind_0, slit_5 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_6), _fx_cleanup);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_0, &v_6, &v_7, 0), _fx_cleanup);
         FX_THROW(&v_7, false, _fx_cleanup);
      }
   }

_fx_cleanup: ;
   fx_free_exn(&curr_exn_0);
   FX_FREE_STR(&v_0);
   fx_free_exn(&v_1);
   FX_FREE_ARR(&data_0);
   if (data_1) {
      _fx_free_LT2BN14K_form__atom_t(&data_1);
   }
   if (v_2) {
      _fx_free_LLT2BN14K_form__atom_t(&v_2);
   }
   if (v_3) {
      _fx_free_N14K_form__ktyp_t(&v_3);
   }
   if (v_4) {
      _fx_free_N14K_form__ktyp_t(&v_4);
   }
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_5);
   FX_FREE_STR(&v_6);
   fx_free_exn(&v_7);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM13normalize_modR17K_form__kmodule_t4N16Ast__defmodule_tLN14K_form__kexp_tiB(
   struct _fx_N16Ast__defmodule_t_data_t* minfo_0,
   struct _fx_LN14K_form__kexp_t_data_t* kcode_typedefs_0,
   int_ toposort_idx_0,
   bool is_main_0,
   struct _fx_R17K_form__kmodule_t* fx_result,
   void* fx_fv)
{
   _fx_LN12Ast__scope_t modsc_0 = 0;
   _fx_LN10Ast__exp_t v_0 = 0;
   _fx_T2LN14K_form__kexp_tLT2SR10Ast__loc_t v_1 = {0};
   _fx_LN14K_form__kexp_t kcode_0 = 0;
   _fx_LT2SR10Ast__loc_t pragmas_0 = 0;
   fx_str_t v_2 = {0};
   _fx_LN14K_form__kexp_t __fold_result___0 = 0;
   _fx_LN14K_form__kexp_t v_3 = 0;
   _fx_Li v_4 = 0;
   _fx_R14Ast__pragmas_t v_5 = {0};
   int fx_status = 0;
   _fx_free_LT2N14K_form__atom_ti(&_fx_g29K_normalize__idx_access_stack);
   _fx_g29K_normalize__idx_access_stack = 0;
   _fx_N12Ast__scope_t v_6;
   _fx_M3AstFM8ScModuleN12Ast__scope_t1i(minfo_0->u.defmodule_t.t2, &v_6);
   FX_CALL(_fx_cons_LN12Ast__scope_t(&v_6, 0, true, &modsc_0), _fx_cleanup);
   FX_COPY_PTR(minfo_0->u.defmodule_t.t4, &v_0);
   FX_CALL(
      _fx_M11K_normalizeFM9eseq2codeT2LN14K_form__kexp_tLT2SR10Ast__loc_t3LN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(v_0,
         kcode_typedefs_0, modsc_0, &v_1, 0), _fx_cleanup);
   FX_COPY_PTR(v_1.t0, &kcode_0);
   FX_COPY_PTR(v_1.t1, &pragmas_0);
   _fx_R9Ast__id_t v_7 = minfo_0->u.defmodule_t.t0;
   _fx_R9Ast__id_t v_8 = minfo_0->u.defmodule_t.t0;
   FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&v_8, &v_2, 0), _fx_cleanup);
   _fx_LN14K_form__kexp_t lst_0 = kcode_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN14K_form__kexp_t r_0 = 0;
      _fx_N14K_form__kexp_t a_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LN14K_form__kexp_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LN14K_form__kexp_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, &v_3);
   FX_COPY_PTR(minfo_0->u.defmodule_t.t5, &v_4);
   FX_CALL(_fx_M3AstFM13parse_pragmasRM9pragmas_t1LT2SRM5loc_t(pragmas_0, &v_5, 0), _fx_cleanup);
   _fx_make_R17K_form__kmodule_t(&v_7, minfo_0->u.defmodule_t.t2, toposort_idx_0, &v_2, v_3, v_4, false, is_main_0, &v_5,
      fx_result);

_fx_cleanup: ;
   FX_FREE_LIST_SIMPLE(&modsc_0);
   if (v_0) {
      _fx_free_LN10Ast__exp_t(&v_0);
   }
   _fx_free_T2LN14K_form__kexp_tLT2SR10Ast__loc_t(&v_1);
   if (kcode_0) {
      _fx_free_LN14K_form__kexp_t(&kcode_0);
   }
   if (pragmas_0) {
      _fx_free_LT2SR10Ast__loc_t(&pragmas_0);
   }
   FX_FREE_STR(&v_2);
   if (__fold_result___0) {
      _fx_free_LN14K_form__kexp_t(&__fold_result___0);
   }
   if (v_3) {
      _fx_free_LN14K_form__kexp_t(&v_3);
   }
   FX_FREE_LIST_SIMPLE(&v_4);
   _fx_free_R14Ast__pragmas_t(&v_5);
   return fx_status;
}

FX_EXTERN_C int _fx_M11K_normalizeFM21normalize_all_modulesLR17K_form__kmodule_t1Li(
   struct _fx_Li_data_t* modules_0,
   struct _fx_LR17K_form__kmodule_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t __fold_result___0 = 0;
   _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t modules_plus_0 = 0;
   _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t __fold_result___1 = 0;
   _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t v_0 = 0;
   int fx_status = 0;
   int_ n_0 = _fx_M11K_normalizeFM6lengthi1Li(modules_0, 0);
   _fx_Li lst_0 = modules_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t modules_plus_1 = 0;
      _fx_N16Ast__defmodule_t minfo_0 = 0;
      _fx_LN12Ast__scope_t modsc_0 = 0;
      _fx_LN10Ast__exp_t v_1 = 0;
      _fx_LN14K_form__kexp_t kcode_typedefs_0 = 0;
      _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t v_2 = {0};
      int_ m_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &modules_plus_1);
      FX_CALL(_fx_M3AstFM10get_moduleN16Ast__defmodule_t1i(m_0, &minfo_0, 0), _fx_catch_0);
      _fx_N12Ast__scope_t v_3;
      _fx_M3AstFM8ScModuleN12Ast__scope_t1i(m_0, &v_3);
      FX_CALL(_fx_cons_LN12Ast__scope_t(&v_3, 0, true, &modsc_0), _fx_catch_0);
      FX_COPY_PTR(minfo_0->u.defmodule_t.t4, &v_1);
      FX_CALL(
         _fx_M11K_normalizeFM28transform_all_types_and_consLN14K_form__kexp_t3LN10Ast__exp_tLN14K_form__kexp_tLN12Ast__scope_t(
            v_1, 0, modsc_0, &kcode_typedefs_0, 0), _fx_catch_0);
      _fx_make_T2N16Ast__defmodule_tLN14K_form__kexp_t(minfo_0, kcode_typedefs_0, &v_2);
      FX_CALL(_fx_cons_LT2N16Ast__defmodule_tLN14K_form__kexp_t(&v_2, modules_plus_1, false, &modules_plus_1), _fx_catch_0);
      _fx_free_LT2N16Ast__defmodule_tLN14K_form__kexp_t(&__fold_result___0);
      FX_COPY_PTR(modules_plus_1, &__fold_result___0);

   _fx_catch_0: ;
      _fx_free_T2N16Ast__defmodule_tLN14K_form__kexp_t(&v_2);
      if (kcode_typedefs_0) {
         _fx_free_LN14K_form__kexp_t(&kcode_typedefs_0);
      }
      if (v_1) {
         _fx_free_LN10Ast__exp_t(&v_1);
      }
      FX_FREE_LIST_SIMPLE(&modsc_0);
      if (minfo_0) {
         _fx_free_N16Ast__defmodule_t(&minfo_0);
      }
      if (modules_plus_1) {
         _fx_free_LT2N16Ast__defmodule_tLN14K_form__kexp_t(&modules_plus_1);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, &modules_plus_0);
   _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t lst_1 = modules_plus_0;
   for (; lst_1; lst_1 = lst_1->tl) {
      _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t r_0 = 0;
      _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t* a_0 = &lst_1->hd;
      FX_COPY_PTR(__fold_result___1, &r_0);
      FX_CALL(_fx_cons_LT2N16Ast__defmodule_tLN14K_form__kexp_t(a_0, r_0, false, &r_0), _fx_catch_1);
      _fx_free_LT2N16Ast__defmodule_tLN14K_form__kexp_t(&__fold_result___1);
      FX_COPY_PTR(r_0, &__fold_result___1);

   _fx_catch_1: ;
      if (r_0) {
         _fx_free_LT2N16Ast__defmodule_tLN14K_form__kexp_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___1, &v_0);
   _fx_LR17K_form__kmodule_t lstend_0 = 0;
   int_ i_0 = 0;
   _fx_LT2N16Ast__defmodule_tLN14K_form__kexp_t lst_2 = v_0;
   for (; lst_2; lst_2 = lst_2->tl, i_0 += 1) {
      _fx_N16Ast__defmodule_t minfo_1 = 0;
      _fx_LN14K_form__kexp_t kcode_typedefs_1 = 0;
      _fx_R17K_form__kmodule_t res_0 = {0};
      _fx_T2N16Ast__defmodule_tLN14K_form__kexp_t* __pat___0 = &lst_2->hd;
      FX_COPY_PTR(__pat___0->t0, &minfo_1);
      FX_COPY_PTR(__pat___0->t1, &kcode_typedefs_1);
      FX_CALL(
         _fx_M11K_normalizeFM13normalize_modR17K_form__kmodule_t4N16Ast__defmodule_tLN14K_form__kexp_tiB(minfo_1,
            kcode_typedefs_1, i_0, i_0 + 1 == n_0, &res_0, 0), _fx_catch_2);
      _fx_LR17K_form__kmodule_t node_0 = 0;
      FX_CALL(_fx_cons_LR17K_form__kmodule_t(&res_0, 0, false, &node_0), _fx_catch_2);
      FX_LIST_APPEND(*fx_result, lstend_0, node_0);

   _fx_catch_2: ;
      _fx_free_R17K_form__kmodule_t(&res_0);
      if (kcode_typedefs_1) {
         _fx_free_LN14K_form__kexp_t(&kcode_typedefs_1);
      }
      if (minfo_1) {
         _fx_free_N16Ast__defmodule_t(&minfo_1);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LT2N16Ast__defmodule_tLN14K_form__kexp_t(&__fold_result___0);
   }
   if (modules_plus_0) {
      _fx_free_LT2N16Ast__defmodule_tLN14K_form__kexp_t(&modules_plus_0);
   }
   if (__fold_result___1) {
      _fx_free_LT2N16Ast__defmodule_tLN14K_form__kexp_t(&__fold_result___1);
   }
   if (v_0) {
      _fx_free_LT2N16Ast__defmodule_tLN14K_form__kexp_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int fx_init_K_normalize(void)
{
   int fx_status = 0;
   return fx_status;
}

FX_EXTERN_C void fx_deinit_K_normalize(void)
{
   if (_fx_g29K_normalize__idx_access_stack) {
      _fx_free_LT2N14K_form__atom_ti(&_fx_g29K_normalize__idx_access_stack);
   }
}

